Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
12782 Vistas

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
Descartar
Mejor respuesta

Hope this video helpful for you..!

How To Inherit And Create New Report In Odoo

Avatar
Descartar
Mejor respuesta

Page headers and footers are defined in the external layout.

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
ago 24
6359
1
oct 22
24099
1
ago 21
8333
1
jul 21
4336
1
dic 23
29065