diff --git a/addons/account/i18n/account.pot b/addons/account/i18n/account.pot index dded69d6da8..ff0c26d20cf 100644 --- a/addons/account/i18n/account.pot +++ b/addons/account/i18n/account.pot @@ -7032,6 +7032,14 @@ msgid "" "for the base." msgstr "" +#. module: account +#: code:addons/account/models/account_tax.py:0 +#, python-format +msgid "" +"Invoice and credit note repartition should have at least one tax repartition" +" line." +msgstr "" + #. module: account #: code:addons/account/models/account_tax.py:0 #, python-format diff --git a/addons/account/models/account_tax.py b/addons/account/models/account_tax.py index 5b93b0cf889..62788dc1142 100644 --- a/addons/account/models/account_tax.py +++ b/addons/account/models/account_tax.py @@ -189,6 +189,10 @@ class AccountTax(models.Model): if len(invoice_repartition_line_ids) != len(refund_repartition_line_ids): raise ValidationError(_("Invoice and credit note distribution should have the same number of lines.")) + if not invoice_repartition_line_ids.filtered(lambda x: x.repartition_type == 'tax') or \ + not refund_repartition_line_ids.filtered(lambda x: x.repartition_type == 'tax'): + raise ValidationError(_("Invoice and credit note repartition should have at least one tax repartition line.")) + index = 0 while index < len(invoice_repartition_line_ids): inv_rep_ln = invoice_repartition_line_ids[index]