Skip to Content
Menu
This question has been flagged
1 Reply
1380 Views

Hi, i'm searching a solution for this, but i can't find.


The need is to print for some invoices (mass printing) selecting some invoices, and depending on a field on this invoices (for example a boolean) it prints one report or another.

Invoice per invoice is easy, but printing some invoices the action only prints the first report. Like as a return on py, and don't print the second reports, any ideas?

Avatar
Discard
Best Answer

Hi Roger Escola Belarte,

As per our understanding, You need to Print 2 report base on the selected Boolean field in the Invoices

If you are selected Multiple Invoices then also based on the selected Boolean field your report is print.

So Can you please try to directly add a condition on the report when calling Invoice Report?

Like please find following condition on xml:

<template id="report_invoice">

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

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

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

            <t t-if="o.boolean_field">

            <t t-call="account.report_invoice_document" t-lang="lang"/>

            </t>

            <t t-if="not o.boolean_field">

            <t t-call="account.report_invoice_document_another_report" t-lang="lang"/>

            </t>

        </t>

    </t>

</template>

Thanks

Regards,




Email:      odoo@aktivsoftware.com  

Skype: kalpeshmaheshwari

   

Avatar
Discard