首页 > 解决方案 > 如何继承 qweb 报告模板并替换 odoo 中的元素

问题描述

我想在我的 payslip qweb 报告中替换 t 元素及其下的所有数据。那是 t 元素及其下的所有内容

<t t-call="web.internal_layout">
   <div class="page">
       <table class="table table-sm table-bordered">
        ............
       </table>
     </div>
</t>

我努力了

  <template id="report_payslip_inherit_logo" inherit_id="hr_payroll.report_payslip">
            
    <xpath expr="//t[1]" position="replace">
    </xpath>
            

但它给出了一个不在视图中的错误。

标签: xmlodooodoo-13

解决方案


你可以直接给XPathlike t-callthis。代码:

<xpath expr="//t[@t-call='web.internal_layout']" position="replace">
    <!-- Your Code -->
</xpath>

推荐阅读