Odoo 12 在每一页上报告发票详细信息。如何实现?

Odoo 12 report invoice details on every page. How to achieve?

我正在使用 Odoo 12 并且有法律要求,无论报告发票和销售报告如何。 我必须在每个报告页面(不仅仅是第一个)上显示文档详细信息(文档类型、编号、日期等)。

因此,核心 Odoo 报告发票允许我仅在第一页打印此信息。 在 Odoo 报告发票中,我们有(第一页):

Customer Name
Customer Address
...
Country
VAT

下面我们有文档详细信息,包括编号、日期等。

我需要做的是在页面顶部显示文档详细信息(从第2页开始),例如:

Customer: Customer Name
Document Type: Invoice
Number: INV XXX/2020
Issue Date: 10-10-2020

我可以将所需的值添加到 qweb 中的变量,但现在不知道如何检查 page > 1.

谁能帮我在第一页以外的每一页的顶部添加此信息? 我已经搜索过,但找不到任何解决方案。

pmatos,

尝试将此添加到您的报告模板中。在此,您必须在 header 部分添加您的内容数据(包括文档类型、编号、日期等)。

<template id="external_layout_standard_customise" inherit_id="web.external_layout_standard">
    <xpath expr="//div[hasclass('header')]" position="inside">
        <t t-if="o and o._name == 'sale.order'">
            <div class="pull-right">
                <h2>
                    <t t-if="not (env.context.get('proforma', False) or is_pro_forma)">
                        <span t-if="doc.state not in ['draft','sent']">Order # </span>
                        <span t-if="doc.state in ['draft','sent']">Quotation # </span>
                    </t>
                    <t t-if="env.context.get('proforma', False) or is_pro_forma">
                        <span>Pro-Forma Invoice # </span>
                    </t>
                    <span t-field="doc.name"/>
                </h2>
            </div>
        </t>
    </xpath>
</template>

谢谢