簡體   English   中英

如何通過替換“div[@class='page']”正確自定義Qweb報告? 奧多 14

[英]How to customize a Qweb report properly by replacing “div[@class='page']”? Odoo 14

我正在嘗試自定義 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 系統會吸收很多能量,但我祝你一切順利:)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM