【发布时间】:2018-02-07 17:25:40
【问题描述】:
我正在使用 odoo 10 中的 qweb 报告。这就是我所做的
<odoo>
<template id="report_customer">
<t t-call="report.html_container">
<t t-set="data_report_margin_top" t-value="50"/>
<t t-foreach="range(5)" t-as="1">
<t t-foreach="docs" t-as="o">
<t t-call="report.internal_layout">
<div class="page example-css-class">
<h2>Report title</h2>
<p>This object's name is
<span t-field="o.full_name"/>
</p>
<ul class="list-inline">
<li>Page:</li>
<li><span class="page"/></li>
<li>/</li>
<li><span class="topage"/></li>
</ul>
</div>
</t>
</t>
</t>
</t>
</template>
</odoo>
我也试过这个
<odoo>
<template id="report_customer">
<t t-call="report.html_container">
<t t-set="data_report_margin_top" t-value="50"/>
<t t-foreach="range(5)" t-as="1">
<t t-foreach="docs" t-as="o">
<t t-call="report.internal_layout">
<div class="page example-css-class">
<h2>Report title</h2>
<p>This object's name is
<span t-field="o.full_name"/>
</p>
<div class="footer" style="text-align: center !important;">
Page <span class="page"/> of <span class="topage"/>
</div>
</div>
</t>
</t>
</t>
</t>
</template>
</odoo>
但在这两种情况下我都看不到页码。我还尝试在单独的模板中添加自定义页眉和页脚,但这也不起作用。
【问题讨论】:
-
我认为这与css有关,Page:是否打印在工作表上
-
第一个问题是页脚在页面内:
-
是的,在纸张上打印没有任何问题,我也尝试将它放在
pagediv 之后。 -
你需要使用
report.internal_layout吗?使用report.external_layout,页面已经默认出现在页脚
标签: odoo odoo-10 odoo-9 qwebview