-
-
Notifications
You must be signed in to change notification settings - Fork 535
[16.0][MIG] mrp_warehouse_calendar #895
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
[16.0][MIG] mrp_warehouse_calendar #895
Conversation
* fix error calculating the planned date depending on the hour. * relicense to lgpl to allow broader use in customizations.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: manufacture-13.0/manufacture-13.0-mrp_warehouse_calendar Translate-URL: https://translation.odoo-community.org/projects/manufacture-13-0/manufacture-13-0-mrp_warehouse_calendar/
…arehouse calendar
e5bce2e
to
7d7ba9f
Compare
@api.onchange("date_planned_start", "product_id") | ||
def _onchange_date_planned_start(self): | ||
res = super(MrpProduction, self)._onchange_date_planned_start() | ||
def _compute_date_planned_finished(self): | ||
res = super(MrpProduction, self)._compute_date_planned_finished() |
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.
be carefull with the decorator, does the compute have/need an api.onchange?
6b1dc94
to
430f3d8
Compare
res = super(MrpProduction, self)._onchange_date_planned_start() | ||
@api.depends("company_id", "date_planned_start", "is_planned", "product_id") | ||
def _compute_date_planned_finished(self): | ||
res = super(MrpProduction, self)._compute_date_planned_finished() | ||
if self.date_planned_start and not self.is_planned: |
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.
Use a loop "for production in self" to not get singleton errors.
27f5235
to
6766693
Compare
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.
Code and functional review OK!
@api.depends("company_id", "date_planned_start", "is_planned", "product_id") | ||
def _compute_date_planned_finished(self): | ||
for production in self: | ||
res = super(MrpProduction, self)._compute_date_planned_finished() |
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.
you are creating a loop inside a loop here by calling super with all records inside the for.
you should call super first outside the loop, then iterate (ideally a filtered recordset) and update what's needed.
6766693
to
d799214
Compare
d799214
to
fe5e393
Compare
/ocabot merge nobump |
On my way to merge this fine PR! |
This PR has the |
@LoisRForgeFlow your merge command was aborted due to failed check(s), which you can inspect on this commit of 16.0-ocabot-merge-pr-895-by-LoisRForgeFlow-bump-nobump. After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red. |
/ocabot merge nobump |
This PR looks fantastic, let's merge it! |
Congratulations, your PR was merged at e3664d1. Thanks a lot for contributing to OCA. ❤️ |
/ocabot migration mrp_warehouse_calendar |
Standard Migration to v16
@ForgeFlow