Always clear cached amount before storing it

This is safer as if for some reason the cache is filled with wrong data, the
values will be fixed instead of keep propagating it.
This commit is contained in:
Cédric Krier
2024-06-13 12:32:08 +02:00
parent 347a161353
commit 09985de225
6 changed files with 22 additions and 12 deletions
-4
View File
@@ -119,10 +119,6 @@ class Amendment(Workflow, ModelSQL, ModelView):
line.apply(sale)
# Force saved lines
sale.lines = sale.lines
# Force recompute cache
sale.untaxed_amount_cache = None
sale.tax_amount_cache = None
sale.total_amount_cache = None
Sale.save(sales)
Sale.store_cache(sales)