-
-
Notifications
You must be signed in to change notification settings - Fork 694
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 mig base product mass addition #1393
16.0 mig base product mass addition #1393
Conversation
…ss to product.product may still use the feature
…TBD in another PR
Currently translated at 7.1% (1 of 14 strings) Translation: product-attribute-14.0/product-attribute-14.0-base_product_mass_addition Translate-URL: https://translation.odoo-community.org/projects/product-attribute-14-0/product-attribute-14-0-base_product_mass_addition/fr/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: product-attribute-15.0/product-attribute-15.0-base_product_mass_addition Translate-URL: https://translation.odoo-community.org/projects/product-attribute-15-0/product-attribute-15-0-base_product_mass_addition/
Currently translated at 100.0% (10 of 10 strings) Translation: product-attribute-15.0/product-attribute-15.0-base_product_mass_addition Translate-URL: https://translation.odoo-community.org/projects/product-attribute-15-0/product-attribute-15-0-base_product_mass_addition/es/
a34dcf0
to
186c213
Compare
cr = self.env.cr | ||
Model = self._build_model(self.pool, cr) | ||
Model._log_access = set(LOG_ACCESS_COLUMNS) | ||
return super(ProductProduct, self).write(vals) |
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.
we should revert the changes done in Model after the write, don't you think ?
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.
@legalsylvain do you consider changes made by @aiendry-aktivsoftware solve your case ? It seems it's on the way !?
Thanks both for your contributions.
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.
well, on that topic, I'm not an expert of the core framework of odoo. (never played modifying technical field like _log_access and rebuild model). Not sure if there are side effect, or if it is safe.
@pedrobaeza : a point of view, here ?
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.
This will have side effects sooner than later for sure, so it should be forbidden.
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.
thanks a lot for your analysis.
186c213
to
3f0c81a
Compare
3f0c81a
to
936f18a
Compare
@@ -0,0 +1,2 @@ | |||
Adding new implementations would be great: | |||
on sale.order or on stock.picking.batch for instance. |
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.
https://github.com/OCA/sale-workflow/tree/14.0/sale_quick exist for now
and also
https://github.com/acsone/stock-logistics-workflow/tree/14.0/stock_picking_quick
Then ROADMAP.rst may be deleted I suppose
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.
(and moved into the description part).
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.
Thanks for porting this module !
nipick: Trivial proposal inlines.
question : you adapted the code for V16, removing "modified" orverload by "write" overload. I fear that rebuilding two times the model (Model = self._build_model(self.pool, cr)) can be slow. Did you faced some performance issue.
Model = self._build_model(self.pool, cr) | ||
Model._auto = False | ||
Model._log_access = set(list([])) | ||
res = super(ProductProduct, self).write(vals) |
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.
res = super(ProductProduct, self).write(vals) | |
res = super().write(vals) |
cr = self.env.cr | ||
Model = self._build_model(self.pool, cr) | ||
Model._auto = False | ||
Model._log_access = set(list([])) |
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.
Model._log_access = set(list([])) | |
Model._log_access = set() |
is the same, no ?
@@ -0,0 +1,2 @@ | |||
Adding new implementations would be great: | |||
on sale.order or on stock.picking.batch for instance. |
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.
(and moved into the description part).
@@ -26,6 +26,7 @@ class ProductProduct(models.Model): | |||
domain="[('category_id', '=', quick_uom_category_id)]", | |||
compute="_compute_quick_uom_id", | |||
inverse="_inverse_set_process_qty", | |||
store=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.
issue: you try to store a field that should be computed on the fly, and not be stored. I guess something is wrong with that design. could you explain that change ? 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.
This is the issue without store=True
tests/test_product_mass_addition.py::TestProductMassAddition::test_quick_line_add
/odoo/src/odoo/fields.py:808: UserWarning: Field product.product.quick_uom_id in dependency of product.product.quick_uom_category_id should be searchable. This is necessary to determine which records to recompute when uom.uom.category_id is modified. You should either make the field searchable, or simplify the field dependency.
It seems there is some kind of dependency race on this.
However I'm not sure there is a need to have the quick_uom_category_id
field since it's not use anywhere in the module and it could be accessed via quick_uom_id.category_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.
By the way the store=True
breaks functionnality on downstream module it sometimes lead to a None valued uom_id on the product
Thanks a lot @legalsylvain for this review. |
The test need And also it seems it's not possible to directly write into metadata anymore, i.e |
It's confirmed that we can't change
which remove all |
To fix the rest of the text instead of relying on |
Hi @aiendry-aktivsoftware Will you continue this PR? THX! |
hi @aiendry-aktivsoftware. Friendly reminder. could you fix the CI so we can move forward ? thanks ! |
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
Done here : #1512 |
Standard migration to version 16.0