-
-
Notifications
You must be signed in to change notification settings - Fork 734
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
[17.0][MIG] stock_packaging_calculator: Migration to 17.0 #2067
[17.0][MIG] stock_packaging_calculator: Migration to 17.0 #2067
Conversation
Customizing the minimal unit was not needed at all. This way we always assume the precision is the on of the UoM.
Allows to ship more information with each element in the list.
Optionally include contained packaging qty.
Allows to reuse the mapping every time is needed.
…g calculator return
Make sure unit is always the last element in the list.
Use _packaging_values_handler ctx key to pass your own handler for specific on demand overrides.
Retrieve quickly packagin bty qty as a string.
This mixin can be used to provide qty by packaging features to any model.
Otherwise translations won't be taken into account.
This way no matter who's changing the behavior of the name getter we'll get the right name.
/ocabot migration stock_packaging_calculator |
class ProductQtyByPackagingMixin(models.AbstractModel): | ||
"""Allow displaying product qty by packaging.""" | ||
|
||
_name = "product.qty_by_packaging.mixin" |
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.
Adding tests for the mixin should be great as it is a transversal feature.
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.
The tests just added
@@ -0,0 +1,4 @@ | |||
TODO |
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.
What about these?
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.
i just fixed this issue. Please have a look.
@classmethod | ||
def setUpClass(cls): | ||
super().setUpClass() | ||
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True)) |
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.
FYI, inheriting from BaseCommon avoid adding this line : https://github.com/odoo/odoo/blob/17.0/odoo/addons/base/tests/common.py#L21
b88fcfd
to
d0633b1
Compare
d0633b1
to
e30a8a6
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 review. Seems great
This PR has the |
/ocabot merge nobump |
Hey, thanks for contributing! Proceeding to merge this for you. |
Congratulations, your PR was merged at 9e24346. Thanks a lot for contributing to OCA. ❤️ |
No description provided.