Store cache in one save
issue6980 review44471002
This commit is contained in:
1 parent
ebec4dcc5c
commit
aadc9da5da
1 file changed
+4
-5
+4
-5
@@ -664,11 +664,10 @@ class Purchase(Workflow, ModelSQL, ModelView, TaxableMixin):
|
||||
@classmethod
|
||||
def store_cache(cls, purchases):
|
||||
for purchase in purchases:
|
||||
cls.write([purchase], {
|
||||
'untaxed_amount_cache': purchase.untaxed_amount,
|
||||
'tax_amount_cache': purchase.tax_amount,
|
||||
'total_amount_cache': purchase.total_amount,
|
||||
})
|
||||
purchase.untaxed_amount_cache = purchase.untaxed_amount
|
||||
purchase.tax_amount_cache = purchase.tax_amount
|
||||
purchase.total_amount_cache = purchase.total_amount
|
||||
cls.save(purchases)
|
||||
|
||||
def _get_invoice_purchase(self):
|
||||
'Return invoice'
|
||||
|
||||
Reference in new issue
Block a user