Always set a value for invoice line unit from UBL invoice and credit note

The search for similar line needs to test if the unit has a value or not.

Closes #14544
This commit is contained in:
Cédric Krier
2026-01-23 12:12:27 +01:00
parent dd7d8c5459
commit b211b58884
+4
View File
@@ -339,6 +339,8 @@ class Invoice(Model):
raise InvoiceError(gettext(
'edocument_ubl.msg_unit_not_found',
code=unit_code))
else:
line.unit = None
else:
line.quantity = 1
line.unit = None
@@ -512,6 +514,8 @@ class Invoice(Model):
raise InvoiceError(gettext(
'edocument_ubl.msg_unit_not_found',
code=unit_code))
else:
line.unit = None
else:
line.quantity = -1
line.unit = None