-
-
Notifications
You must be signed in to change notification settings - Fork 659
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_packaging_container_deposit : performance #1583
base: 16.0
Are you sure you want to change the base?
[16.0][FIX] product_packaging_container_deposit : performance #1583
Conversation
When an order is modified, do not recompute container deposit for each line
21452f0
to
32ca7a9
Compare
res = super( | ||
OrderMixin, self.with_context(skip_update_container_deposit=True) | ||
).write(vals) | ||
self.update_order_container_deposit_quantity() |
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's the point of calling update_order_container_deposit_quantity
if you always skip it?
Also, wouldn't be better to check if there's any update on values that might impact on deposit container lines?
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 skip it during the call to super and call it once done.
When you modify SO lines in the UI, when you save the form, this calls write on SO which in turns calls write on SO line.
If you don't skip at this stage, the update will be performed on each SO line. In addition, those write could trigger other calls to write which will again recompute it.
Your second point could be a further improvement in another PR.
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.
Your second point could be a further improvement in another PR.
I would check - at least - that you are writing on order_line
. That's easy, no?
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.
iI rechecked and update_order_container_deposit_quantity
is already managing that properly
This PR has the |
@simahawk Can we merge this? |
Sorry @jbaudoux you are not allowed to merge. To do so you must either have push permissions on the repository, or be a declared maintainer of all modified addons. If you wish to adopt an addon and become it's maintainer, open a pull request to add your GitHub login to the |
ping @simahawk |
When an order is modified, do not recompute container deposit for each line