# No attribute "footer\_used" error when printing draft invoice report

**URL:** https://discuss.tryton.org/t/no-attribute-footer-used-error-when-printing-draft-invoice-report/7404
**Category:** User
**Created:** [June 21, 2024, 3:17pm UTC](https://discuss.tryton.org/t/no-attribute-footer-used-error-when-printing-draft-invoice-report/7404 "2024-06-21T15:17:56Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![fabalthazar](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/fabalthazar/32/3791_2.png) [@fabalthazar](https://discuss.tryton.org/u/fabalthazar)
#### Post date: [June 21, 2024, 3:17pm UTC](https://discuss.tryton.org/t/no-attribute-footer-used-error-when-printing-draft-invoice-report/7404/1 "2024-06-21T15:17:56Z")

</div>

Hi,

I am trying to print a draft invoice report and I get the following error:

```auto
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:

```auto
<for each="line in invoice.company.footer_used.split('\n')">

```

Here is what I can found in the code about it:

```auto
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 '',
            }

```

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [June 21, 2024, 5:11pm UTC](https://discuss.tryton.org/t/no-attribute-footer-used-error-when-printing-draft-invoice-report/7404/2 "2024-06-21T17:11:28Z")

</div>

Probably you have some syntax error on your footer template which causes and error but is its hidden inside the python property.

---

<div class="post-metadata">

### Author: ![fabalthazar](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/fabalthazar/32/3791_2.png) [@fabalthazar](https://discuss.tryton.org/u/fabalthazar)
#### Post date: [June 21, 2024, 8:20pm UTC](https://discuss.tryton.org/t/no-attribute-footer-used-error-when-printing-draft-invoice-report/7404/3 "2024-06-21T20:20:53Z")

</div>

With no footer (empty), the invoice is correctly generated.  
Adding a single character to it (tested with a single ‘f’ or ‘toto’ or ${name}…) produces the error.  
Same with header.

I have these versions installed:

- trytond v7.2.3
- account\_invoice v7.2.2
- company v7.2.1

Is anybody able to reproduce?

---

<div class="post-metadata">

### Author: ![dave](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/d/ee7513/32.png) [@dave](https://discuss.tryton.org/u/dave)
#### Post date: [June 27, 2024, 12:47pm UTC](https://discuss.tryton.org/t/no-attribute-footer-used-error-when-printing-draft-invoice-report/7404/4 "2024-06-27T12:47:50Z")

</div>

I’ve just tried adding some text to the company headers on [https://demo7.2.tryton.org/](https://demo7.2.tryton.org/) and it seems to be working correctly. Have you got any custom modules activated?

---

<div class="post-metadata">

### Author: ![fabalthazar](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/fabalthazar/32/3791_2.png) [@fabalthazar](https://discuss.tryton.org/u/fabalthazar)
#### Post date: [June 27, 2024, 1:03pm UTC](https://discuss.tryton.org/t/no-attribute-footer-used-error-when-printing-draft-invoice-report/7404/5 "2024-06-27T13:03:31Z")

</div>

No custom module:

Nom,Version,État (chaîne)  
account,7.2.3,Activé  
account\_asset,7.2.1,Activé  
account\_fr,7.2.0,Activé  
account\_invoice,7.2.2,Activé  
account\_payment,7.2.1,Activé  
account\_payment\_sepa,7.2.1,Activé  
account\_payment\_sepa\_cfonb,7.2.0,Activé  
account\_product,7.2.0,Activé  
account\_statement,7.2.2,Activé  
account\_statement\_ofx,7.2.0,Activé  
account\_statement\_rule,7.2.2,Activé  
bank,7.2.1,Activé  
company,7.2.1,Activé  
company\_work\_time,7.2.0,Activé  
country,7.2.1,Activé  
currency,7.2.2,Activé  
ir,Activé  
party,7.2.1,Activé  
party\_siret,7.2.1,Activé  
product,7.2.1,Activé  
res,Activé  
timesheet,7.2.1,Activé

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [June 27, 2024, 2:31pm UTC](https://discuss.tryton.org/t/no-attribute-footer-used-error-when-printing-draft-invoice-report/7404/6 "2024-06-27T14:31:46Z")

</div>

FYI ["footer\_used" KeyError/AttributeError when printing an invoice report (#13366) · Issues · Tryton / Tryton · GitLab](https://bugs.tryton.org/13366)

---

<div class="post-metadata">

### Author: ![system](https://discuss-cdn.tryton.org/uploads/default/original/1X/c6f8ec0a40525cdcd50058c734283450a4b3d38b.png) [@system](https://discuss.tryton.org/u/system)
#### Post date: [July 27, 2024, 2:32pm UTC](https://discuss.tryton.org/t/no-attribute-footer-used-error-when-printing-draft-invoice-report/7404/7 "2024-07-27T14:32:11Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
