How to edit default Header of the invoice Qweb reports . Odoo 14

Viewed 630

I am using Odoo 14, I would like to customize the header of 'report_invoice_document'. I tried to add this code:

<?xml version="1.0" encoding="utf-8"?>
  <odoo>
     <data>
       <template id="report_invoice_extend" inherit_id="account.report_invoice_document">
        <t t-call="my_module.external_layout_footer_inherit_cr">
    
        </t>
     </template>
    </data>
 </odoo>


<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="external_layout_footer_inherit_cr"
            inherit_id="report.external_layout_footer">
            <xpath expr="//div[@class='footer']" position="replace">
                <div class="footer">
                    <span>Test</span>
                </div>
            </xpath>
        </template>
</odoo>

But I got this error :

raise ValueError(formatted_message).with_traceback(from_traceback) from from_exception odoo.exceptions.ValidationError: Error while validating view:

Element '<t t-call="my_module.external_layout_footer_inherit_cr">' cannot be located in parent view

What's wrong in my code? Please help.

1 Answers

As an example

<div class="article page" t-attf-data-oe-model="account.move" t-attf-data-oe-id="{{o.id}}" t-attf-style="color:{{style.text_color}} !important;font-size:{{int(style.body_font)}}px !important;font-family:{{style.font_family}} !important;">
</div>

Related