From 41756ed7e036c219b18576299a5ebaac0a99b705 Mon Sep 17 00:00:00 2001 From: Bernat Brunet Torruella Date: Sun, 8 Jul 2018 23:01:54 +0200 Subject: [PATCH] Fix problem when set sii key from invoice tax information --- invoice.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/invoice.py b/invoice.py index b8319fc..cd87491 100644 --- a/invoice.py +++ b/invoice.py @@ -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: