如何继承QWeb报告模板并替换ODO中的T元素

问题描述

我想在我的薪资单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>
            

但是它给出了不在视图中的错误

解决方法

您可以像这样直接将XPath赋予t-call。 代码:

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