Test also the amount of invoice lines without product to compute the UNCEFACT type

Closes #12426
This commit is contained in:
Cédric Krier
2023-07-22 16:37:00 +02:00
parent 604ae9aa31
commit 7309e38115
+2 -2
View File
@@ -89,12 +89,12 @@ class Invoice(Model):
@cached_property
def type_code(self):
if self.invoice.type == 'out':
if all(l.amount < 0 for l in self.lines if l.product):
if all(l.amount < 0 for l in self.lines):
return '381'
else:
return '380'
else:
if all(l.amount < 0 for l in self.lines if l.product):
if all(l.amount < 0 for l in self.lines):
return '261'
else:
return '389'