Skip to Content
Menu
This question has been flagged
2 Replies
2440 Views

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
Discard
Best Answer

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
Discard
Best Answer

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
Discard
Related Posts Replies Views Activity
0
Jul 25
378
2
Jun 25
1558
3
Feb 25
2457
1
Nov 24
2167
4
May 24
5750