Hi,
I am trying to print a draft invoice report and I get the following error:
AttributeError: "company.company,1" has no attribute "footer_used". Did you mean: 'header_used'?
The company has a footer defined.
Looking at the report template, the export is designed to work with draft invoices, so I don’t understand what’s wrong with “footer_used”.
Any idea?
Thanks,
Fabrice
EDIT:
Here is how the OpenDocument template uses the footer_used
method:
<for each="line in invoice.company.footer_used.split('\n')">
Here is what I can found in the code about it:
class Company(ModelSQL, ModelView):
[...]
footer = fields.Text(
'Footer',
help="The text to display on report footers.\n" + _SUBSTITUTION_HELP)
[...]
@property
def footer_used(self):
return Template(self.footer or '').safe_substitute(self._substitutions)
@property
def _substitutions(self):
address = self.party.address_get()
tax_identifier = self.party.tax_identifier
return {
'name': self.party.name,
'phone': self.party.phone,
'mobile': self.party.mobile,
'fax': self.party.fax,
'email': self.party.email,
'website': self.party.website,
'address': (
' '.join(address.full_address.splitlines())
if address else ''),
'tax_identifier': tax_identifier.code if tax_identifier else '',
}