我第一次在这里发布内容,希望它能起作用!我试图在Odoo 11中创建一个自定义报告,在我做的一个自定义模块中,我一直在跟踪可以收集的数据,但无法克服以下问题。所以我创建了这样的报告: <report id="production_order_report2" model="pb.orders.products" string="Production Order (English)" report_type="qweb-pdf" name="probespoketest.production_order_report_en2_template" file="probespoketest.production_order_report_en2_template" attachment_use="False" />我的Qweb报告是: <template id="production_order_report_en2_template"> <t t-call="web.html_container"> <t t-foreach="docs" t-as="o"> <t t-call="web.internal_layout"> <div class="page"> <h2>Report title</h2> <p>This object's name is</p> <t t-esc="testing()"/> </div> </t> </t> </t> </template>我的python代码是:from odoo import api, fields, models, _class OrderProductsFunctions(models.AbstractModel): _name = 'report.probespoketest.production_order_report_en2_template' def _testing(self): result = 0 return result我的错误是: Odoo Server Error Traceback (most recent call last): File "/opt/odoo/odoo11/odoo/addons/base/ir/ir_qweb/qweb.py", line 342, in _compiled_fn return compiled(self, append, new, options, log) File "<template>", line 1, in template_1454_24554 File "<template>", line 2, in body_call_content_24553 File "<template>", line 3, in foreach_24552 File "<template>", line 4, in body_call_content_24551 TypeError: 'NoneType' object is not callable
添加回答
举报
0/150
提交
取消