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
This commit is contained in:
Cédric Krier committed 2026-01-23 15:29:07 +01:00
1 parent 7c8e7bc23f
commit daad7943e6
1 file changed
+4 -2
+4 -2
View File
@@ -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)