summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreLBati <lorenzo.battistini@agilebg.com>2016-05-02 14:51:47 +0200
committerOlivier Dony <odo@openerp.com>2016-06-02 00:41:51 +0200
commit58cb0bcbc507fc3ed80e42e85399edbcc42003f7 (patch)
treef717a35943e4d4da4f13315089dbeea19d23d486
parentb698caf42e8abe369dc14450d4d76ee83e5a76cd (diff)
[FIX] account: avoid deleting taxes when they are linked to move lines
Equivalent of 8c337f97433e437aac050e0af614bfdd812bfbdd but for account.move.line as well. Closes #11883
-rw-r--r--addons/account/models/account_move.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py
index 2ed0c30ad7a..2c3486541d6 100644
--- a/addons/account/models/account_move.py
+++ b/addons/account/models/account_move.py
@@ -379,7 +379,7 @@ class AccountMoveLine(models.Model):
date = fields.Date(related='move_id.date', string='Date', required=True, index=True, default=fields.Date.context_today, store=True, copy=False)
analytic_line_ids = fields.One2many('account.analytic.line', 'move_id', string='Analytic lines', oldname="analytic_lines")
tax_ids = fields.Many2many('account.tax', string='Taxes')
- tax_line_id = fields.Many2one('account.tax', string='Originator tax')
+ tax_line_id = fields.Many2one('account.tax', string='Originator tax', ondelete='restrict')
analytic_account_id = fields.Many2one('account.analytic.account', string='Analytic Account')
company_id = fields.Many2one('res.company', related='account_id.company_id', string='Company', store=True)
counterpart = fields.Char("Counterpart", compute='_get_counterpart', help="Compute the counter part accounts of this journal item for this journal entry. This can be needed in reports.")