跳至內容
選單
此問題已被標幟
2 回覆
12450 瀏覽次數

I need to customise the invoice format : header , footer , page , and replace the existing one. I tried with this solution , but when printing the invoice , I got an empty document. Any help please ? Here is my code :

<?xml version="1.0" encoding="utf-8"?>

<odoo>

    <data>

        <record id="account_invoices" model="ir.actions.report">

            <field name="name">Invoices</field>

            <field name="model">account.move</field>

            <field name="report_type">qweb-pdf</field>

            <field name="report_name">my_module.report_invoice_with_payments</field>

            <field name="report_file">my_module.report_invoice_with_payments</field>

            <field name="print_report_name">(object._get_report_base_filename())</field>

            <field name="attachment">(object.state == 'posted') and ((object.name or 'INV').replace('/','_')+'.pdf')</field>

            <field name="binding_model_id" ref="model_account_move"/>

            <field name="binding_type">report</field>

            <field name="groups_id" eval="[(4, ref('account.group_account_invoice')),

 (4, ref('account.group_account_readonly'))]"/>

        </record>





 <template id="report_invoice_with_payments">

            <t t-call="web.html_container">


                <t t-foreach="docs" t-as="o">

                <div class="article" t-attf-data-oe-model="account.move" t-attf-data-oe-id="{{o.id}}">

                </div>

                    <t t-set="lang" t-value="o.invoice_user_id.sudo().lang if o.move_type in ('in_invoice', 'in_refund') else o.partner_id.lang"/>

                    <t t-set="print_with_payments" t-value="True"/>

                    <t t-if="o._get_name_invoice_report() == 'my_module.new_report_invoice_document'"

                        t-call="my_module.new_report_invoice_document" t-lang="lang"/>

                </t>

            </t>

        </template>

</data>

</odoo>



<template id="new_report_invoice_document">

            <t t-call="web.external_layout">

....

</template>


Is there any other solution to do it ? Thanks.

頭像
捨棄
最佳答案

Hope this video helpful for you..!

How To Inherit And Create New Report In Odoo

頭像
捨棄
最佳答案

Page headers and footers are defined in the external layout.

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
8月 24
6071
1
10月 22
23745
1
8月 21
8091
1
7月 21
4143
1
12月 23
28111