-
-
Notifications
You must be signed in to change notification settings - Fork 270
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][FIX] product_variant_configurator: Solve recursion error. #331
[16.0][FIX] product_variant_configurator: Solve recursion error. #331
Conversation
This fix solves a recursion problem caused when the groupby refers to a field of a many2one model, and that model also has the same field name. In this example, the stock.valuation.layer.tree view contains a groupby product_id, and the product.product model already has a product_id field, relating to the same model. Without this code we would reach a recursion error
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.
Makes sense 👍🏼
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.
Great hack for avoiding to do other massive changes, and well documented for not having future doubts about its usage. The test coverage is limited though, so this can fail again in the future (or future versions), but it will require a tour test for recreating the condition, so let's continue as is.
/ocabot merge patch
What a great day to merge this nice PR. Let's do it! |
Congratulations, your PR was merged at 2b568a9. Thanks a lot for contributing to OCA. ❤️ |
@pedrobaeza thanks for your review. |
This fix solves a recursion problem caused when the groupby refers to a field of a many2one model, and that model also has the same field name. In this example, the stock.valuation.layer.tree view contains a groupby product_id, and the product.product model already has a product_id field, relating to the same model. Without this code we would reach a recursion error.
Fixes #330
cc @JordiMForgeFlow @MarinaAForgeFlow @LauraCForgeFlow @pedrobaeza