Skip to content

Commit

Permalink
[BUG] the invalidate recordset call is harming the abilitity to save …
Browse files Browse the repository at this point in the history
…updated records in sale.order, with this change seems to solve it and the extension seems working, needs review
  • Loading branch information
IJOL committed Sep 27, 2024
1 parent 5abce08 commit d5cf77b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sale_triple_discount/models/sale_order_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def triple_discount_preprocess(self):
this method is called multiple times.
Updating the cache provides consistency through re-computations."""
prev_values = dict()
self.invalidate_recordset(self._discount_fields())
# self.invalidate_recordset(self._discount_fields())
for line in self:
prev_values[line] = {
fname: line[fname] for fname in self._discount_fields()
Expand All @@ -118,9 +118,9 @@ def triple_discount_preprocess(self):
def triple_discount_postprocess(self, prev_values):
"""Restore the discounts of the lines in the dictionary prev_values.
Updating the cache provides consistency through re-computations."""
self.invalidate_recordset(self._discount_fields())
# self.invalidate_recordset(self._discount_fields())
for line, prev_vals_dict in list(prev_values.items()):
line.update(prev_vals_dict)
line._cache.update(prev_vals_dict)

def _convert_to_tax_base_line_dict(self):
self.ensure_one()
Expand Down

0 comments on commit d5cf77b

Please sign in to comment.