Check 347 taxes when has a tax

#041304
This commit is contained in:
Raimon Esteve 2020-09-17 10:49:36 +02:00
parent 9c4625fbf7
commit 14633959f5

View file

@ -143,10 +143,11 @@ class Invoice(metaclass=PoolMeta):
def check_347_taxes(self): def check_347_taxes(self):
include = False include = False
for tax in self.taxes: for tax in self.taxes:
if tax.tax.operation_347 == 'exclude_invoice': if tax.tax:
return False if tax.tax.operation_347 == 'exclude_invoice':
if tax.tax.operation_347 != 'ignore': return False
include = True if tax.tax.operation_347 != 'ignore':
include = True
return include return include
@fields.depends('type', 'aeat347_operation_key') @fields.depends('type', 'aeat347_operation_key')