Skip to content

Commit

Permalink
[FIX] product_packaging_container_deposit
Browse files Browse the repository at this point in the history
When a SO is modified, do not recompute container deposit for each line
  • Loading branch information
jbaudoux committed Apr 17, 2024
1 parent 477ba0a commit 21452f0
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2023 Camptocamp (<https://www.camptocamp.com>).
# Copyright 2024 Jacques-Etienne Baudoux (BCIM) <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import logging
from functools import partial
Expand Down Expand Up @@ -108,3 +109,11 @@ def copy(self, default=None):
return super(
OrderMixin, self.with_context(skip_update_container_deposit=True)
).copy(default=default)

def write(self, vals):
# When a SO is modified, don't recompute container deposit for each line
res = super(
OrderMixin, self.with_context(skip_update_container_deposit=True)
).write(vals)
self.update_order_container_deposit_quantity()
return res

0 comments on commit 21452f0

Please sign in to comment.