Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
12828 Visualizzazioni

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.

Avatar
Abbandona
Risposta migliore

Hope this video helpful for you..!

How To Inherit And Create New Report In Odoo

Avatar
Abbandona
Risposta migliore

Page headers and footers are defined in the external layout.

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
ago 24
6412
1
ott 22
24145
1
ago 21
8364
1
lug 21
4373
1
dic 23
29203