From daad7943e65667957e9036db25a596fa2c3a0482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 23 Jan 2026 15:29:07 +0100 Subject: [PATCH] Set the invoice type on invoice line from UBL invoice The invoice type is needed to set the right account from the product. Closes #14547 --- modules/edocument_ubl/edocument.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/edocument_ubl/edocument.py b/modules/edocument_ubl/edocument.py index 900a519e30..b41d2d85a0 100644 --- a/modules/edocument_ubl/edocument.py +++ b/modules/edocument_ubl/edocument.py @@ -351,7 +351,8 @@ class Invoice(Model): account_configuration = AccountConfiguration(1) - line = Line(type='line', company=company, currency=currency) + line = Line( + type='line', company=company, currency=currency, invoice_type='in') if (invoiced_quantity := invoice_line.find('./{*}InvoicedQuantity') ) is not None: line.quantity = float(invoiced_quantity.text) @@ -526,7 +527,8 @@ class Invoice(Model): account_configuration = AccountConfiguration(1) - line = Line(type='line', company=company, currency=currency) + line = Line( + type='line', company=company, currency=currency, invoice_type='in') if (credited_quantity := credit_note_line.find('./{*}CreditedQuantity') ) is not None: line.quantity = -float(credited_quantity.text)