-
-
Notifications
You must be signed in to change notification settings - Fork 695
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
[11.0][MIG] packaging_uom #469
Conversation
…management : update readme
This change is required to make the code working with existing addons without breaking tets. By declaring an invers on qty, we are able to assign/create the required uom to the package based on the expected qty
When a sale order is confirmed and product packaging is filled in sale order line(s), the information is propagated through procurement orders and stock moves. This is conditioned by a parameter on procurement rule.
stock_inventory_discrepancy has caused the test error |
@rousseldenis done!, thanks #470 |
You can rebase now |
@pedrobaeza rebase done, thanks! |
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
@@ -10,10 +9,10 @@ class ProductPackaging(models.Model): | |||
|
|||
@api.model | |||
def _default_uom_categ_domain_id(self): | |||
uom_id = self.env.context.get("get_uom_categ_from_uom") |
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.
@jhumfer You delete this behaviour but you let the context in view. Could you explain why you changed this ?
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.
With the change to version 11, the product.packaging model has a product.product associated instead of product.template, causing the "get_uom_categ_from_uom" context to stop working.
I have modified it in view as well.
@@ -11,7 +11,7 @@ | |||
<page name="packaging" string="Packaging" attrs="{'invisible':[('type','=','service')]}" groups="product.group_stock_packaging" > | |||
<group name="packaging" string="Packaging"> | |||
<field name="packaging_ids" string="Configurations" | |||
context="{'get_uom_categ_from_uom': parent.uom_id, 'tree_view_ref':'product.product_packaging_tree_view_product', 'form_view_ref': 'product.product_packaging_form_view_without_product'}"/> | |||
context="{'tree_view_ref':'product.product_packaging_tree_view_product', 'form_view_ref': 'product.product_packaging_form_view_without_product'}"/> |
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.
@jhumfer Ok you deleted it, but I think 'default_product_id' is not defined when creating packaging in existing product form, so when does the domain function '_default_uom_categ_domain_id' work ?
The default uom was correctly loaded before.
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.
Have you tested it in the interface?
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, I have tested it in the interface and it works correctly. This ensures that 'default_product_id' is defined when creating the package in the existing product form
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.
Just tested in the interface.
Ok through product form.
KO through the product packages menu (create from scratch). The domain should be correctly computed after having selected the product.
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.
Fixed from product packages menu
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.
Is there a problem for the validation?
Is there a problem for the validation? |
Is there a problem with the validation? |
@jhumfer There were problems with Github. Is it normal that you closed this ? |
4 similar comments
@jhumfer There were problems with Github. Is it normal that you closed this ? |
@jhumfer There were problems with Github. Is it normal that you closed this ? |
@jhumfer There were problems with Github. Is it normal that you closed this ? |
@jhumfer There were problems with Github. Is it normal that you closed this ? |
It has been a mistake. I have reopened it. Why is not it validated? |
What do you want to say by 'validation' ? |
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
I have solved the issues from your review. Would you kindly accept the pull request? |
Done ! |
@OCA/logistics-maintainers |
Can you clean a bit commit history, removing that ugly merge operation? |
39620b0
to
c2bdf20
Compare
Done, is this enough? |
@jhumfer I think you made mistake to your branch. Commits are duplicated. If you clean, I think you can squash all commits after '[MIG] packaging_uom: Migration to 11.0' into that one. If you think they have their own existence, keep them. |
c2bdf20
to
bfaba3f
Compare
Done, thanks! |
@jhumfer Quite done. You left a modification in stock_inventory_discrepancy/tests/test_inventory_discrepancy.py. Remove that one. |
bfaba3f
to
734ebde
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 only
The packaging view, from the product.template model, is still not working properly. The get_uom_categ_from_uom context is not working. |
cc @guadaltech