跳至内容
菜单
此问题已终结
2 回复
2437 查看

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.



形象
丢弃
最佳答案

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

形象
丢弃
最佳答案

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.

形象
丢弃
相关帖文 回复 查看 活动
0
7月 25
377
2
6月 25
1550
3
2月 25
2455
1
11月 24
2161
4
5月 24
5749