3
我是odoo的新手,我通过继承sales_order创建了一个模块创建自定义报告。我在打印报告时遇到上述错误。需要帮助吗?QWebException:“NoneType”对象在评估“doc.with_context({'lang':doc.partner_id.lang})时没有属性'with_context'”“
以下是代码片段:
测试/ my_module.py:
class sale_order(models.Model):
_name = 'sale.order'
_description = 'Inheritance'
_inherit = 'sale.order'
测试/视图/ report_template_view.xml:
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="test_report">
<t t-call="report.html_container">
<t t-call="report.internal_layout">
<t t-set="doc" t-value="doc.with_context({'lang':doc.partner_id.lang})"/>
<div class="page">
<div class="oe_structure"/>
<div> <strong><left>User</left></strong>
<p t-field="doc.user_id"/>
</div>
</div>
</t>
</t>
</template>
</data>
如何访问记录在custom_report_template
?
我也想知道。你有没有发现? – user568021