mirror of
https://gitlab.com/datalifeit/trytond-aeat_sii
synced 2023-12-13 20:30:37 +01:00
Fix bug when from party not found it's tax_identifier field
This commit is contained in:
parent
414962b381
commit
58808b5c96
1 changed files with 6 additions and 1 deletions
7
aeat.py
7
aeat.py
|
@ -990,7 +990,12 @@ class SIIReportLine(ModelSQL, ModelView):
|
|||
return self.invoice.sii_operation_key if self.invoice else None
|
||||
|
||||
def get_vat_code(self, name):
|
||||
return self.invoice.party.tax_identifier.code if self.invoice else None
|
||||
if self.invoice and self.invoice.party_tax_identifier:
|
||||
return self.invoice.party_tax_identifier.code
|
||||
elif self.invoice and self.invoice.party.tax_identifier:
|
||||
return self.invoice.party.tax_identifier.code
|
||||
else:
|
||||
return None
|
||||
|
||||
def get_identifier_type(self, name):
|
||||
return self.invoice.party.sii_identifier_type if self.invoice else None
|
||||
|
|
Loading…
Reference in a new issue