Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
2589 Представления

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.

Аватар
Отменить
Related Posts Ответы Просмотры Активность
0
июл. 25
505
2
июн. 25
1893
3
февр. 25
2726
1
нояб. 24
2460
4
мая 24
6025