Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xml 继承并修改account.report\u invoice\u document表_Xml_Templates_Report_Odoo_Odoo 12 - Fatal编程技术网

Xml 继承并修改account.report\u invoice\u document表

Xml 继承并修改account.report\u invoice\u document表,xml,templates,report,odoo,odoo-12,Xml,Templates,Report,Odoo,Odoo 12,您好,我正在尝试创建一个pdf,它继承了用于替换表的报表模板account.report\u invoice\u文档。但我有这个问题 AttributeError: 'NoneType' object has no attribute 'with_context' Error to render compiling AST AttributeError: 'NoneType' object has no attribute 'with_context' Template: 1045 Path

您好,我正在尝试创建一个pdf,它继承了用于替换表的报表模板account.report\u invoice\u文档。但我有这个问题

AttributeError: 'NoneType' object has no attribute 'with_context' 
Error to render compiling AST AttributeError: 'NoneType' object has no attribute 'with_context' 
Template: 1045 Path: /templates/t/t/t[1] 
Node: <t t-set="o" t-value="o.with_context(lang=lang)"/>
没有继承,我没有问题

我的代码:

密码 完成日期 数量 付款方式 报告

    <report 
        attachment_use="True" 
        id="certificate_report" 
        menu="False"
        name="ngo_payment_certificate.certificate_donation_template" 
        paperformat="ngo_payment_certification_donation_certificate" 
        report_type="qweb-pdf" 
        string="Donations Certificate"
        model="ngo.donor"
        ></report>

在“清单”上,我有一个独立的帐户

问题与文档一起出现,您应该使用o调用打印输出中的字段

<tbody>
  <tr>
                        <td>
                            <span t-esc="o.donation_name"/>
                        </td>
                        <td class="text-center">
                            <span t-esc="o.donation_date_done"/>
                        </td>
                        <td class="text-center">
                            <span t-esc="o.donation_amount"/>
                        </td>
                        <td class="text-center">
                            <span t-esc="o.payment_method"/>
                        </td>
                    </tr>
                </t>

如果捐赠名称在account.invoice模型中。

如果两者属于同一个模型,则只能继承qweb模板。

否这些字段不在account.invoice模型中,而是在我的模型中。我只是尝试使用帐户模板并替换表。