Search code examples
xmlodooodoo-13

How do I inherit a qweb report template and replace a t element in odoo


I want to replace the t element and every data under it in my payslip qweb report. That is the t element and everything that comes under it

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

I have tried

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

But it gives an error that is not located in the view.


Solution

  • You can directly give the XPath to the t-call like this. Code:

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