1
我想在我的客戶報告中添加外部佈局頁眉和頁腳。自定義模塊報告上的外部佈局odoo9
我的自定義模塊:
class my_module(osv.osv):
_name = "my.module"
_description = "my module"
_columns = {
'name': fields.char('Name',size=256),
'date': fields.date('Date', select=True),
'user': fields.many2one('res.users', 'User', select=True, track_visibility='onchange'),
'description':fields.html('Description'),
}
在報告中,我從項目的模塊添加一行external_layout:
<t t-foreach="docs" t-as="doc">
<t t-call="report.external_layout">
<t t-set="doc" t-value="doc.with_context({'lang':doc.partner_id.lang})" />
<div class="page">
<div class="row">
<div class="col-xs-12 text-center"><h2><b>MY REPORT</b></h2></div>
</div>
</div>
當打開時報告出現錯誤:
Error message:
"'my.module' object has no attribute 'partner_id'" while evaluating
"doc.with_context({'lang':doc.partner_id.lang})"