Fix bug when get information from tax

This commit is contained in:
Bernat Brunet Torruella 2018-07-08 23:09:34 +02:00
parent 41756ed7e0
commit dda2e37d3a
1 changed files with 3 additions and 3 deletions

View File

@ -170,13 +170,13 @@ class Invoice:
def _set_sii_keys(self):
tax = None
for t in self.taxes:
if t.tax_used:
tax = t
if t.txa.tax_used:
tax = t.tax
break
if not tax:
return
for field in _SII_INVOICE_KEYS:
setattr(self, field, getattr(tax.tax, field))
setattr(self, field, getattr(tax, field))
@fields.depends(*_SII_INVOICE_KEYS)
def _on_change_lines_taxes(self):