我使用的是odoo 9企业版。
我必须在PDF文件中自定义会计报告的页眉和页脚,例如损益、资产负债表。
我搜索了很多,但似乎对自定义的页眉和页脚无能为力。
提前谢谢。
发布于 2017-07-18 14:54:33
在没有页眉和页脚的帐户报表中,odoo用来调用继承这些报表更改report.external_layout的report.internal_layout.by。这是我通过继承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>我希望你能理解work..or到底做了什么。
https://stackoverflow.com/questions/44761295
复制相似问题