首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何更改odoo企业默认报表的页眉和页脚,例如PDF格式的损益、资产负债表

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

Stack Overflow用户
提问于 2017-06-26 21:48:13
回答 1查看 3.6K关注 0票数 4

我使用的是odoo 9企业版。

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

我搜索了很多,但似乎对自定义的页眉和页脚无能为力。

提前谢谢。

EN

回答 1

Stack Overflow用户

发布于 2017-07-18 14:54:33

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

代码语言:javascript
复制
<?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财务报表。

代码语言:javascript
复制
<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>

我希望你能理解work..or到底做了什么。

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44761295

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档