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
[13.0][IMP] sale_by_packaging can be sold #1375
Conversation
b6dc7dc
to
cc999ea
Compare
cc999ea
to
edb553f
Compare
I have added a unit test. |
90d5e4e
to
b2263c8
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.
LG but small improvement required on tests.
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 review
@@ -18,3 +19,8 @@ class ProductPackaging(models.Model): | |||
"When the user will put 3 as quantity, the system can force the " | |||
"quantity to the superior unit (5 for this example).", | |||
) | |||
|
|||
@api.depends("packaging_type_id") |
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.
@api.depends("packaging_type_id") | |
@api.depends("packaging_type_id.can_be_sold") |
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.
@rousseldenis I think this is done on purpose: you don't want this value to change if the type changes its value.
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.
Yes that is how it was requested.
You get the default "can_be_sold" value when selecting a packaging_type. But afterwards you can change it on the product.packaging.
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.
@rousseldenis ping :)
@TDu pls squash :) |
This change allows to be more specific on which product.packaging can be sold or not. By default the value from the product.packaging.type is used. But it is editable afterwards, with this change.
21b4036
to
7025c74
Compare
@simahawk Squash done |
@rousseldenis piiiing :) |
/ocabot merge minor |
On my way to merge this fine PR! |
Congratulations, your PR was merged at de30cab. Thanks a lot for contributing to OCA. ❤️ |
This change allows to be more specific on which product.packaging can be
sold or not.
By default the value from the product.packaging.type is used. But it is
editable afterwards, with this change.