This question has been flagged

hello i'm trying to add my custom res.company fields to the header of the financial reports "balance sheet, profit and loss, etc." so i found where the view  is "acount_report.main_template" in the repor_finacial.xml file, so i made a module and with the xpath i got in to the template so if i add static elements it works perfectly, but the question is how to add my custom fields in this header?, the structure of the template is kind of different from what i've seen in other reports, is there any idea, i was trying with qweb only, but probably i would need some python.

Avatar
Discard
Author Best Answer

The solution was easier than i thought, i'll post it here for someone that could need it

<span t-field="res_company.nit"></span>

# so you just need to inherit the template for this reports,
template id="reportes_header_pdf" inherit_id="account_reports.filter_info_template">
<
xpath expr="//div[hasclass('print_only')]" position="inside">
        
            here you paste the code from the financial report template to make your changes
            like adding your custom fields
    <span t-field="res_company.nit"></span>
    </xpath>
</
template>
Avatar
Discard