为了账号安全,请及时绑定邮箱和手机立即绑定

Odoo 11 Qweb自定义报告:渲染编译AST TypeError的错误:

Odoo 11 Qweb自定义报告:渲染编译AST TypeError的错误:

MMMHUHU 2021-05-14 19:58:38
我第一次在这里发布内容,希望它能起作用!我试图在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
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 217 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号