[IMP] account: store tax base amount

Storing the value is necessary in case tax definition is changed.
Indeed, we want to keep the value for reporting purpose.

opw-691177
This commit is contained in:
Nicolas Martinelli
2016-10-18 15:49:45 +02:00
parent 523355b99f
commit 1f9e92dfef
+2 -1
View File
@@ -1334,6 +1334,7 @@ class AccountInvoiceTax(models.Model):
_description = "Invoice Tax"
_order = 'sequence'
@api.depends('invoice_id.invoice_line_ids')
def _compute_base_amount(self):
for tax in self:
base = 0.0
@@ -1355,7 +1356,7 @@ class AccountInvoiceTax(models.Model):
sequence = fields.Integer(help="Gives the sequence order when displaying a list of invoice tax.")
company_id = fields.Many2one('res.company', string='Company', related='account_id.company_id', store=True, readonly=True)
currency_id = fields.Many2one('res.currency', related='invoice_id.currency_id', store=True, readonly=True)
base = fields.Monetary(string='Base', compute='_compute_base_amount')
base = fields.Monetary(string='Base', compute='_compute_base_amount', store=True)