diff --git a/addons/account/i18n/account.pot b/addons/account/i18n/account.pot index c3de090c92f..560a049aeab 100644 --- a/addons/account/i18n/account.pot +++ b/addons/account/i18n/account.pot @@ -6071,6 +6071,14 @@ msgid "" "entry again and cancel it thanks to a regular revert." msgstr "" +#. module: account +#: code:addons/account/models/account_move.py:0 +#, python-format +msgid "" +"It seems that the taxes have been modified since the creation of the journal" +" entry. You should create the credit note manually instead." +msgstr "" + #. module: account #: model_terms:ir.ui.view,arch_db:account.view_move_form msgid "JRNL/2016/00001" diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 13ca6ebd4b5..c66f9728b0e 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -2121,6 +2121,8 @@ class AccountMove(models.Model): elif line_vals.get('tax_repartition_line_id'): # Tax line. invoice_repartition_line = self.env['account.tax.repartition.line'].browse(line_vals['tax_repartition_line_id']) + if invoice_repartition_line not in tax_repartition_lines_mapping: + raise UserError(_("It seems that the taxes have been modified since the creation of the journal entry. You should create the credit note manually instead.")) refund_repartition_line = tax_repartition_lines_mapping[invoice_repartition_line] # Find the right account.