details:   https://code.tryton.org/tryton/commit/3134b59848ef
branch:    default
user:      Cédric Krier <[email protected]>
date:      Fri Jan 23 15:29:07 2026 +0100
description:
        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
diffstat:

 modules/edocument_ubl/edocument.py |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (23 lines):

diff -r dbba242942a5 -r 3134b59848ef modules/edocument_ubl/edocument.py
--- a/modules/edocument_ubl/edocument.py        Fri Jan 23 13:02:19 2026 +0100
+++ b/modules/edocument_ubl/edocument.py        Fri Jan 23 15:29:07 2026 +0100
@@ -351,7 +351,8 @@
 
         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 @@
 
         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)

Reply via email to