[英]How to customize a Qweb report properly by replacing “div[@class='page']”? Odoo 14
I'm trying to customize a report_invoice_document qweb report.我正在尝试自定义 report_invoice_document qweb 报告。 Here is the source code, So I'm trying to replace "div[@class='page']" and build my own report with the following code:
这是源代码,所以我尝试替换“div[@class='page']”并使用以下代码构建我自己的报告:
<template id="report_invoice_extend" inherit_id="account.report_invoice_document">
<xpath expr="//div[@class='page']/" position="replace">
<span>Customer Invoice Report</span>
</xpath>
</template>
But I'm getting the following error:但我收到以下错误:
File "/usr/lib/python3/dist-packages/odoo/tools/template_inheritance.py", line 132, in apply_inheritance_specs
node = locate_node(source, spec)
File "/usr/lib/python3/dist-packages/odoo/tools/template_inheritance.py", line 58, in locate_node
xPath = etree.ETXPath(expr)
File "src/lxml/xpath.pxi", line 482, in lxml.etree.ETXPath.__init__
File "src/lxml/xpath.pxi", line 423, in lxml.etree.XPath.__init__
File "<string>", line None
lxml.etree.XPathSyntaxError: Invalid expression
Any help please?请问有什么帮助吗?
expr="//div[@class='page']"
instead of expr="//div[@class='page']/"
expr="//div[@class='page']"
而不是expr="//div[@class='page']/"
Focus bro focus!重点哥重点!
I know, working with the odoo system will absorb so much energy, but I wish you the best:)我知道,使用 odoo 系统会吸收很多能量,但我祝你一切顺利:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.