How to change the header and footer for an odoo enterprise standard report, for example. Profit and loss, Balance in PDF

I am using the enterprise class version of odoo 9.

I need to set up the header and footer of accounting reports, for example. Profit and loss, Balance in PDF file.

I searched a lot, but it seemed helplessly setting the header and footer.

Thanks in advance.

+4
source share
1 answer

, , report.internal_layout.by, report.external_layout. , .

<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <data>
        <template id="external_layout_header_inherit_cr" 
            inherit_id="report.external_layout_header">
            <xpath expr="//div[@class='header']" position="replace">
                <div class="header">
                    <!-- you're code here -->
                </div>
            </xpath>
        </template>
        <template id="external_layout_footer_inherit_cr" 
            inherit_id="report.external_layout_footer">
            <xpath expr="//div[@class='footer']" position="replace">
                <div class="footer">
                    <!-- you're code here -->
                </div>
            </xpath>
        </template>
    </data>
</odoo>

, .

<template id="report_financial_inherit" 
            inherit_id="module_name.inherit_id">
            <xpath expr="//t[@t-call='report.internal_layout']" position="replace">
                <!-- here they are calling internal report only but i'm using 
                external layout becoz in external layout i have header and footer  -->
                <t t-call="report.external_layout">
                    <div class="page">
                        <!--add oddo financial report code/ your custom code-->
                    </div>
                </t>
            </xpath>
        </template>

, , ... .

-1

Source: https://habr.com/ru/post/1680119/


All Articles