【发布时间】:2021-03-01 11:18:10
【问题描述】:
我正在使用 Odoo 14,我想自定义“report_invoice_document”的标题。 我尝试添加此代码:
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="report_invoice_extend" inherit_id="account.report_invoice_document">
<t t-call="my_module.external_layout_footer_inherit_cr">
</t>
</template>
</data>
</odoo>
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="external_layout_footer_inherit_cr"
inherit_id="report.external_layout_footer">
<xpath expr="//div[@class='footer']" position="replace">
<div class="footer">
<span>Test</span>
</div>
</xpath>
</template>
</odoo>
但我收到了这个错误:
raise ValueError(formatted_message).with_traceback(from_traceback) from from_exception odoo.exceptions.ValidationError: Error while validating view:
Element '<t t-call="my_module.external_layout_footer_inherit_cr">' cannot be located in parent view
我的代码有什么问题?请帮忙。
【问题讨论】:
-
如果要制作自定义抬头发票,必须在body类中添加data-oe-model和data-oe-id。
-
@Aung Ko Ko Lin,你能举个例子吗?
-
@Obay Abd-Algader,我编辑了帖子,我尝试了链接中的解决方案,但出现以下错误:元素 '
' 不能位于父视图中
标签: javascript python xml odoo