details: https://code.tryton.org/tryton/commit/52ecc484f6a3
branch: 7.8
user: Cédric Krier <[email protected]>
date: Thu Jan 22 17:39:35 2026 +0100
description:
Do not search unit of measure for unit code ZZ and XZZ from UBL
The mutually defined unit should let the system choose a default unit.
Closes #14537
(grafted from ebe6527b6ff31b573d727118aa6da1f6cc3e7402)
diffstat:
modules/edocument_ubl/edocument.py | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diffs (23 lines):
diff -r 3ae6e2f93d28 -r 52ecc484f6a3 modules/edocument_ubl/edocument.py
--- a/modules/edocument_ubl/edocument.py Mon Jan 19 16:21:30 2026 +0100
+++ b/modules/edocument_ubl/edocument.py Thu Jan 22 17:39:35 2026 +0100
@@ -329,7 +329,8 @@
if (invoiced_quantity := invoice_line.find('./{*}InvoicedQuantity')
) is not None:
line.quantity = float(invoiced_quantity.text)
- if (unit_code := invoiced_quantity.get('unitCode')) is not None:
+ if (unit_code := invoiced_quantity.get('unitCode')) not in {
+ None, 'ZZ', 'XZZ'}:
try:
line.unit, = UoM.search([
('unece_code', '=', unit_code),
@@ -501,7 +502,8 @@
if (credited_quantity := credit_note_line.find('./{*}CreditedQuantity')
) is not None:
line.quantity = -float(credited_quantity.text)
- if (unit_code := credited_quantity.get('unitCode')) is not None:
+ if (unit_code := credited_quantity.get('unitCode')) not in {
+ None, 'ZZ', 'XZZ'}:
try:
line.unit, = UoM.search([
('unece_code', '=', unit_code),