如何通过替换“div[@class='page']”正确自定义Qweb报表?奥多14

2024-06-11 04:44:22 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试自定义报表、发票、文档和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

需要帮忙吗


Tags: inreportdividnode报表linepage
1条回答
网友
1楼 · 发布于 2024-06-11 04:44:22

expr="//div[@class='page']"而不是expr="//div[@class='page']/"

专注,兄弟,专注

我知道,使用奥多系统会消耗很多能量,但我祝你一切顺利:)

相关问题 更多 >