Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
12773 Vizualizări

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.

Imagine profil
Abandonează
Cel mai bun răspuns

Hope this video helpful for you..!

How To Inherit And Create New Report In Odoo

Imagine profil
Abandonează
Cel mai bun răspuns

Page headers and footers are defined in the external layout.

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
2
aug. 24
6355
1
oct. 22
24095
1
aug. 21
8328
1
iul. 21
4333
1
dec. 23
29050