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

Hello guys 
I want to display total no of items purchased or total quantities on the invoice while printing.
I have tried to inherit the template ID and add the sum fields but it is not working 

Please help

How can I display the total quantities on the invoice report.



Avatar
Annuleer
Beste antwoord

Hi,

To add the total number of quantities in the invoice report, Try below code


<template id="inherit_report_invoice_document"
inherit_id="account.report_invoice_document">
<xpath expr="//tbody[hasclass('invoice_tbody')]"
               position="inside">

               <t t-set="quantity_set" t-value="0.0"/>

       </xpath>

<xpath expr="//td[@name='account_invoice_line_name']"

               position="after">

               <t t-set="quantity_set" t-value="quantity_set + line.quantity"/>

       </xpath>

        <xpath expr="//t[@t-foreach='lines']"

position="after">

               <div>Total Quantity : <t t-out="quantity_set"/></div>

</xpath>


</template>


Add the above code in your custom module, and the output be like


Hope it helps

Avatar
Annuleer
Beste antwoord

With great difficulty as Odoo in their wisdom have removed functionality in relation to the use of Studio to make very simple changes to a VERY IMPORTANT DOCUMENT of a business INVOICES and quotes etc. Errordoo strikes again. Thanks Odoo great work. We currently have people paying us a tax free total amount as this unchangeable value is on our invoices. Geez when was 17 released Hmmm a long time ago.

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
0
jul. 25
499
2
jun. 25
1869
3
feb. 25
2705
1
nov. 24
2442
4
mei 24
6005