Skip to content
Snippets Groups Projects
Commit 68814f52 authored by Julien Van Roy's avatar Julien Van Roy
Browse files

[FIX] account_edi_ubl_cii: invoice lines could have multiple fixed taxes

An UBL Bis 3 xml can only contain one tax per invoice line. However,
there might be one or more ecotaxes on invoice lines in Belgium. Do not
block the user from generating the attachment in this case.

Note that PR https://github.com/odoo/odoo/pull/121494

 will properly
handle the fixed taxes upon generating UBL attachments.

opw-3318969

closes odoo/odoo#121833

Signed-off-by: default avatarWilliam André (wan) <wan@odoo.com>
parent 211f2fce
No related branches found
No related tags found
No related merge requests found
......@@ -351,9 +351,10 @@ class AccountEdiXmlUBLBIS3(models.AbstractModel):
) if intracom_delivery else None,
}
for line in invoice.line_ids:
if len(line.tax_ids) > 1:
for line in invoice.invoice_line_ids:
if len(line.tax_ids.filtered(lambda t: t.amount_type != 'fixed')) != 1:
# [UBL-SR-48]-Invoice lines shall have one and only one classified tax category.
# /!\ exception: possible to have any number of ecotaxes (fixed tax) with a regular percentage tax
constraints.update({'cen_en16931_tax_line': _("Each invoice line shall have one and only one tax.")})
return constraints
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment