【发布时间】:2021-03-02 09:12:47
【问题描述】:
我正在尝试自定义 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
有什么帮助吗?
【问题讨论】:
-
尝试删除 xpath 表达式中的尾部斜杠。
标签: javascript python xml odoo