Reputation:
I need to extend invoice report with field note. but I'm getting error that field does not exist. I'm stuck and don't know how to reach that field. did tried with partner_id.note
too but also getting error.
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="report_invoice_document" inherit_id="account.report_invoice_document">
<xpath expr="//div[@class='page']/*[last()]" position="after">
<div class="row">
<div class="col-xs-6">
<span t-esc="o.note"/><br/>
<div class="left_sign_block">
<span>Note</span>
</div>
</div>
</div>
</xpath>
</template>
</data>
</openerp>
class AccountInvoiceTax(models.Model):
_inherit = 'account.invoice.tax'
note = fields.Text(related='tax_id.note', string='Note')
QWebException: "'account.invoice' object has no attribute 'note'" while evaluating 'o.note'
Upvotes: 1
Views: 103
Reputation: 14768
You have extended the model account.invoice.tax
and not account.invoice
. The error message is correct. So either you extend invoice or you have to use note
from the invoice tax lines (tax_line_ids
).
Upvotes: 1