Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
12775 Weergaven

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
Annuleer
Beste antwoord

Hope this video helpful for you..!

How To Inherit And Create New Report In Odoo

Avatar
Annuleer
Beste antwoord

Page headers and footers are defined in the external layout.

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
2
aug. 24
6355
1
okt. 22
24096
1
aug. 21
8329
1
jul. 21
4334
1
dec. 23
29051