Skip to content

Conversation

JoanSForgeFlow
Copy link
Contributor

Standard Migration to v16

@ForgeFlow

@JoanSForgeFlow JoanSForgeFlow force-pushed the 16.0-mig-mrp_warehouse_calendar branch from e5bce2e to 7d7ba9f Compare November 11, 2022 12:49
Comment on lines 10 to 12
@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()
Copy link
Contributor

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?

@JoanSForgeFlow JoanSForgeFlow force-pushed the 16.0-mig-mrp_warehouse_calendar branch 3 times, most recently from 6b1dc94 to 430f3d8 Compare November 14, 2022 09:10
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:
Copy link
Member

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.

@JoanSForgeFlow JoanSForgeFlow force-pushed the 16.0-mig-mrp_warehouse_calendar branch 2 times, most recently from 27f5235 to 6766693 Compare November 16, 2022 15:50
Copy link
Member

@BernatPForgeFlow BernatPForgeFlow left a 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()
Copy link
Contributor

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.

@JoanSForgeFlow JoanSForgeFlow force-pushed the 16.0-mig-mrp_warehouse_calendar branch from 6766693 to d799214 Compare November 17, 2022 12:50
@JoanSForgeFlow JoanSForgeFlow force-pushed the 16.0-mig-mrp_warehouse_calendar branch from d799214 to fe5e393 Compare November 17, 2022 12:52
@LoisRForgeFlow
Copy link
Contributor

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 16.0-ocabot-merge-pr-895-by-LoisRForgeFlow-bump-nobump, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Nov 18, 2022
Signed-off-by LoisRForgeFlow
@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@OCA-git-bot
Copy link
Contributor

@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.

@LoisRForgeFlow
Copy link
Contributor

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 16.0-ocabot-merge-pr-895-by-LoisRForgeFlow-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 983446e into OCA:16.0 Nov 18, 2022
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at e3664d1. Thanks a lot for contributing to OCA. ❤️

@LoisRForgeFlow LoisRForgeFlow deleted the 16.0-mig-mrp_warehouse_calendar branch November 18, 2022 15:36
@LoisRForgeFlow
Copy link
Contributor

/ocabot migration mrp_warehouse_calendar

@OCA-git-bot OCA-git-bot added this to the 16.0 milestone Nov 29, 2022
@OCA-git-bot OCA-git-bot mentioned this pull request Nov 29, 2022
28 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants