From b211b58884c7c105801af8da5f8ed2de502c1fd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 23 Jan 2026 12:12:27 +0100 Subject: [PATCH] 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 --- modules/edocument_ubl/edocument.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/edocument_ubl/edocument.py b/modules/edocument_ubl/edocument.py index ebad313bb9..41a8b04fd6 100644 --- a/modules/edocument_ubl/edocument.py +++ b/modules/edocument_ubl/edocument.py @@ -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