-
-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[17.0][MIG] maintenance_plan: Migration to 17.0 #414
[17.0][MIG] maintenance_plan: Migration to 17.0 #414
Conversation
… equipment maintenance team is not filled [ADD] icon.png
[UPD] Update maintenance_plan.pot
Currently translated at 100.0% (30 of 30 strings) Translation: maintenance-12.0/maintenance-12.0-maintenance_plan Translate-URL: https://translation.odoo-community.org/projects/maintenance-12-0/maintenance-12-0-maintenance_plan/es/ [UPD] README.rst
…nt company maintenance_plan 12.0.1.1.0
[ADD] instructions and notes to Plan - Add menus for maintenance plans. - Set active button on maintenance plans. improve navigation to maintenance plans. [ADD] post-migration script
[UPD] Update maintenance_plan.pot [UPD] README.rst maintenance_plan 12.0.3.0.0 Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: maintenance-12.0/maintenance-12.0-maintenance_plan Translate-URL: https://translation.odoo-community.org/projects/maintenance-12-0/maintenance-12-0-maintenance_plan/
[UPD] Update maintenance_plan.pot Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: maintenance-12.0/maintenance-12.0-maintenance_plan Translate-URL: https://translation.odoo-community.org/projects/maintenance-12-0/maintenance-12-0-maintenance_plan/
Currently translated at 98.4% (63 of 64 strings) Translation: maintenance-12.0/maintenance-12.0-maintenance_plan Translate-URL: https://translation.odoo-community.org/projects/maintenance-12-0/maintenance-12-0-maintenance_plan/es/
[UPD] Update maintenance_plan.pot [UPD] README.rst Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: maintenance-13.0/maintenance-13.0-maintenance_plan Translate-URL: https://translation.odoo-community.org/projects/maintenance-13-0/maintenance-13-0-maintenance_plan/
[UPD] Update maintenance_plan.pot maintenance_plan 13.0.1.1.0 Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: maintenance-13.0/maintenance-13.0-maintenance_plan Translate-URL: https://translation.odoo-community.org/projects/maintenance-13-0/maintenance-13-0-maintenance_plan/ pre-commit update
Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: maintenance-13.0/maintenance-13.0-maintenance_plan Translate-URL: https://translation.odoo-community.org/projects/maintenance-13-0/maintenance-13-0-maintenance_plan/
…patible. includes migration scripts
[UPD] Update maintenance_plan.pot [UPD] README.rst Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: maintenance-13.0/maintenance-13.0-maintenance_plan Translate-URL: https://translation.odoo-community.org/projects/maintenance-13-0/maintenance-13-0-maintenance_plan/
[UPD] Update maintenance_plan.pot [UPD] README.rst
Currently translated at 100.0% (69 of 69 strings) Translation: maintenance-14.0/maintenance-14.0-maintenance_plan Translate-URL: https://translation.odoo-community.org/projects/maintenance-14-0/maintenance-14-0-maintenance_plan/it/
* Use latest request_date both for done and todo searches. * When there is a latest done apply interval Co-authored-by: Lois Rilo <lois.rilo@forgeflow.com> Co-authored-by: LoisRForgeFlow <LoisRForgeFlow@users.noreply.github.com> maintenance_plan 14.0.1.0.1
Currently translated at 100.0% (69 of 69 strings) Translation: maintenance-14.0/maintenance-14.0-maintenance_plan Translate-URL: https://translation.odoo-community.org/projects/maintenance-14-0/maintenance-14-0-maintenance_plan/it/
* only consider request after the start maintenance date. * todo request ordered asc. * add more tests. maintenance_plan 14.0.1.0.2
I think we should restore the cron. The idea they are providing is not bad and improves their last version, but I think it is not enough. |
1340bc8
to
f86fb60
Compare
@pedrobaeza |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@pedrobaeza @astirpe @etobella |
A PSC or maintainer should confirm, like @etobella |
maintenance_plan/__manifest__.py
Outdated
"author": "Camptocamp SA, ForgeFlow, Odoo Community Association (OCA)", | ||
"license": "AGPL-3", | ||
"category": "Maintenance", | ||
"website": "https://github.com/OCA/maintenance", | ||
"images": [], | ||
"depends": ["base_maintenance"], | ||
"depends": ["base_maintenance", "maintenance"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think maintenance is not required (base_maintenance depends on it)
https://github.com/OCA/maintenance/blob/17.0/base_maintenance/__manifest__.py#L12
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, my mistake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@etobella
Done.
@@ -23,17 +21,17 @@ def post_init_hook(cr, registry): | |||
|
|||
for equipment in equipments: | |||
request = equipment.maintenance_ids.filtered( | |||
lambda r: r.maintenance_type == "preventive" | |||
lambda r, equipment=equipment: r.maintenance_type == "preventive" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
B023 Function definition does not bind loop variable `equipment
https://docs.astral.sh/ruff/rules/function-uses-loop-variable/`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, it is a new requirement from ruff 👍
f86fb60
to
b4bb3bc
Compare
b4bb3bc
to
9f99863
Compare
This PR has the |
/ocabot merge nobump |
Hey, thanks for contributing! Proceeding to merge this for you. |
Congratulations, your PR was merged at 34b68d6. Thanks a lot for contributing to OCA. ❤️ |
Analyzing the When creating now a request of preventive type and set recurrence (7 days for example), when the status is changed to one defined as “completed” ( Having clarified the above I am not sure that this module is necessary. I comment this because the approach of the migration script will be different (define the corresponding data to use the odoo recurrence or use this module). |
What do you think about my previous comment (OpenUpgrade scripts will depend on it because maybe this module is not necessary)? Ping @carlos-lopez-tecnativa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about my previous comment (OpenUpgrade scripts will depend on it because maybe this module is not necessary)? Ping @carlos-lopez-tecnativa
Thanks for the ping, @victoralmau. I tested this module and have some observations related to its migration.
Regarding recurrency, I believe this module provides a functionality that Odoo does not currently have—the ability to create maintenance requests in advance based on the Planning Horizon
. In Odoo, you can only create the next maintenance request when the current one moves to a stage marked as "Done." However, for preventive maintenance in some contexts, it's necessary to generate all future maintenance requests in advance.
I think this module is still valuable but could benefit from some enhancements. For instance, it would be helpful if all maintenance requests related to the recurrency were visible within the maintenance.request form view, similar to how related tasks are displayed in project.task.
What do you think about this approach?
<field name="context">{ | ||
'default_maintenance_plan_id': id, | ||
}</field> | ||
<field name="domain">[('maintenance_plan_id', '=', id)]</field> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def name_get(self): | ||
result = [] | ||
for plan in self: | ||
result.append( | ||
( | ||
plan.id, | ||
plan.name | ||
or _( | ||
"Unnamed %(kind)s plan (%(eqpmt)s)", | ||
kind=plan.maintenance_kind_id.name or "", | ||
eqpmt=plan.equipment_id.name, | ||
), | ||
) | ||
) | ||
return result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not blocking, but this can be replaced by _compute_display_name
according to the migration guidelines.
https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-17.0
Please let me know the progress on this module's evolution. I plan to start the migration of the |
@carlos-lopez-tecnativa do the PR improving this module for not getting blocked. |
No description provided.