[您好,我正在尝试创建一个继承报告模板account.report_invoice_document的pdf来替换表格。但是我有这个问题
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)"/>
没有继承,我没问题
我的代码:
<template id="certificate_donation_template" inherit_id="account.report_invoice_document">
<xpath expr="//table[@name='invoice_line_table']" position="replace">
<table class="table table-condensed" name="invoice_line_table">
<thead>
<th class="text-center" style="width: 70%">Code</th>
<th class="text-center" style="width: 15%">Date done</th>
<th class="text-center" style="width: 15%">Amount</th>
<th class="text-center" style="width: 15%">Payment Method</th>
</thead>
<tbody>
<t t-as="doc" t-foreach="docs">
<tr>
<td>
<span t-esc="doc['donation_name']"/>
</td>
<td class="text-center">
<span t-esc="doc['donation_date_done']"/>
</td>
<td class="text-center">
<span t-esc="doc['donation_amount']"/>
</td>
<td class="text-center">
<span t-esc="doc['payment_method']"/>
</td>
</tr>
</t>
</tbody>
</table>
</xpath>
</template>
报告
<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>
在__ manifest __上我的受抚养人帐户中>]
[您好,我正在尝试创建一个继承报告模板account.report_invoice_document的pdf来替换表格。但是我有这个问题AttributeError:'NoneType'对象没有属性'...
问题在此处与doc有关,您应该使用o