Test also the amount of invoice lines without product to compute the UNCEFACT type
Closes #12426
This commit is contained in:
1 parent
604ae9aa31
commit
7309e38115
1 file changed
+2
-2
@@ -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'
|
||||
|
||||
Reference in new issue
Block a user