Skip to content
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

[14.0][FIX] mrp_bom_attribute_match: avoid recursion in BOM. #1045

Conversation

ilyasProgrammer
Copy link
Member

No description provided.

@francesco-ooops
Copy link
Contributor

@ivantodorovich what do you think?

Copy link
Contributor

@ivantodorovich ivantodorovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there also a python constraint?

This works well for the UI/UX, but it'd be nice to prevent it at the orm level
Similar to core's https://github.com/odoo/odoo/blob/e53f7ef1be9f7a1cc3fd47d30c4a688d95f10760/addons/mrp/models/mrp_bom.py#L90

mrp_bom_attribute_match/models/mrp_bom.py Outdated Show resolved Hide resolved
@ilyasProgrammer ilyasProgrammer force-pushed the 14.0-mrp_bom_attribute_match-avoid-recursion branch 5 times, most recently from 6bb6f7f to 53957c7 Compare June 6, 2023 07:17
@@ -29,6 +31,18 @@ class MrpBomLine(models.Model):
compute="_compute_product_uom_category_id",
)

@api.constrains("component_template_id", "parent_product_tmpl_id")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@api.constrains("component_template_id", "parent_product_tmpl_id")
@api.constrains("component_template_id")

To supress this log warning:

2023-06-06 07:20:16,529 250 WARNING odoo odoo.models: method mrp.bom.line._check_component_template_recursion: @constrains parameter 'parent_product_tmpl_id' is not writeable 

@ilyasProgrammer ilyasProgrammer force-pushed the 14.0-mrp_bom_attribute_match-avoid-recursion branch from 53957c7 to b31b023 Compare June 6, 2023 11:59
Copy link
Contributor

@francesco-ooops francesco-ooops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functional OK!

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

@ilyasProgrammer ilyasProgrammer force-pushed the 14.0-mrp_bom_attribute_match-avoid-recursion branch from b31b023 to d0f22df Compare June 12, 2023 10:02
@ilyasProgrammer ilyasProgrammer force-pushed the 14.0-mrp_bom_attribute_match-avoid-recursion branch from d0f22df to 2016a06 Compare June 12, 2023 10:07
@francesco-ooops
Copy link
Contributor

@pedrobaeza merge? we added 2 maintainers to be independent as we worked together with @ivantodorovich on this module

@pedrobaeza pedrobaeza added this to the 14.0 milestone Jun 12, 2023
@pedrobaeza
Copy link
Member

/ocabot merge patch

@pedrobaeza pedrobaeza changed the title [FIX] mrp_bom_attribute_match: avoid recursion in BOM. [14.0][FIX] mrp_bom_attribute_match: avoid recursion in BOM. Jun 12, 2023
@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 14.0-ocabot-merge-pr-1045-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 8180a63 into OCA:14.0 Jun 12, 2023
5 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

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

@ilyasProgrammer ilyasProgrammer deleted the 14.0-mrp_bom_attribute_match-avoid-recursion branch October 16, 2023 07:13
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.

None yet

5 participants