diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2016-10-18 15:49:45 +0200 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2016-10-18 15:49:45 +0200 |
| commit | 1f9e92dfef325b6727e1bee3de55bff095ec6cf2 (patch) | |
| tree | 02e1baf419501091f9f72253d8cc54ea77634c7c | |
| parent | 523355b99feb7ab4f4d82dcdbd19631a0f213290 (diff) | |
[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
| -rw-r--r-- | addons/account/models/account_invoice.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index 95ae08e8103..04488a6ea8e 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -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) |
