Clear cached amount when resetting to draft sale, purchase and purchase requisition
Closes #13296 (grafted from 8e441329d11b93ceafa47d553cb23883e5b4ec2f) --HG-- branch : 7.0
This commit is contained in:
@@ -867,7 +867,11 @@ class Purchase(
|
||||
@Workflow.transition('draft')
|
||||
@reset_employee('quoted_by', 'confirmed_by')
|
||||
def draft(cls, purchases):
|
||||
pass
|
||||
cls.write(purchases, {
|
||||
'tax_amount_cache': None,
|
||||
'untaxed_amount_cache': None,
|
||||
'total_amount_cache': None,
|
||||
})
|
||||
|
||||
@classmethod
|
||||
@ModelView.button
|
||||
|
||||
@@ -344,7 +344,11 @@ class PurchaseRequisition(Workflow, ModelSQL, ModelView):
|
||||
@Workflow.transition('draft')
|
||||
@reset_employee('approved_by', 'rejected_by')
|
||||
def draft(cls, requisitions):
|
||||
pass
|
||||
cls.write(requisitions, {
|
||||
'tax_amount_cache': None,
|
||||
'untaxed_amount_cache': None,
|
||||
'total_amount_cache': None,
|
||||
})
|
||||
|
||||
@classmethod
|
||||
@ModelView.button
|
||||
|
||||
@@ -1001,7 +1001,11 @@ class Sale(
|
||||
@Workflow.transition('draft')
|
||||
@reset_employee('quoted_by', 'confirmed_by')
|
||||
def draft(cls, sales):
|
||||
pass
|
||||
cls.write(sales, {
|
||||
'tax_amount_cache': None,
|
||||
'untaxed_amount_cache': None,
|
||||
'total_amount_cache': None,
|
||||
})
|
||||
|
||||
@classmethod
|
||||
@ModelView.button
|
||||
|
||||
Reference in New Issue
Block a user