如何更改odoo企业默认报告的页眉和页脚,例如损益表,资产负债表PDF格式

时间:2017-06-26 13:48:13

标签: pdf openerp odoo-9

我正在使用odoo 9企业版。

我必须自定义会计报告的页眉和页脚,例如损益表,PDF文件中的资产负债表。

我搜索了很多但似乎无法自定义页眉和页脚。

提前致谢。

1 个答案:

答案 0 :(得分:-1)

在帐户报告中,页眉和页脚没有来到那里odoo用来调用report.internal_layout.by继承那些报告更改report.external_layout。 这是我继承odoo页眉和页脚的自定义页眉和页脚的代码。

<?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>

现在我通过改变它来改变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>

我希望你明白实际上有什么工作......或者做。