我正在尝试自定义report_invoice_document qweb报告。这里是源代码,所以我试图替换"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>
但是我得到以下错误:
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
请帮忙好吗?
用expr="//div[@class='page']/"
代替expr="//div[@class='page']"
聚焦兄弟聚焦!
我知道,使用odoo系统会吸收很多能量,但我祝你一切顺利:)