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})"