Fix problem when set sii key from invoice tax information

This commit is contained in:
Bernat Brunet Torruella 2018-07-08 23:01:54 +02:00
parent 984e061d68
commit 41756ed7e0
1 changed files with 5 additions and 1 deletions

View File

@ -168,7 +168,11 @@ class Invoice:
return credit
def _set_sii_keys(self):
tax = self.taxes and self.taxes[0]
tax = None
for t in self.taxes:
if t.tax_used:
tax = t
break
if not tax:
return
for field in _SII_INVOICE_KEYS: