Protect report attribute getters from null invoices
Invoice will be null for query reports if the invoice is not found
This commit is contained in:
parent
679b9b342c
commit
070729ff05
8
aeat.py
8
aeat.py
|
@ -775,10 +775,14 @@ class SIIReportLine(ModelSQL, ModelView):
|
|||
'Identifier Type'), 'get_identifier_type')
|
||||
|
||||
def get_vat_code(self, name):
|
||||
return self.invoice.party.vat_code
|
||||
return (
|
||||
self.invoice.party.vat_code
|
||||
if self.invoice and self.invoice.party else None)
|
||||
|
||||
def get_identifier_type(self, name):
|
||||
return self.invoice.party.sii_identifier_type
|
||||
return (
|
||||
self.invoice.party.sii_identifier_type
|
||||
if self.invoice and self.invoice.party else None)
|
||||
|
||||
@staticmethod
|
||||
def default_company():
|
||||
|
|
Loading…
Reference in New Issue