Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
5 Replies
11956 Tampilan

I would like to use the following field in PDF invoice report:

<span t-field="l.quantity">

which displays the quantity.

In our particular deployment there is only integer values for quantities. How can I display quantities using without displaying decimal places?


Avatar
Buang
Penulis Jawaban Terbai

I found the answer somewhere on the internet. I do not know if this is documented somewhere or not:

<span  t-esc="int(l['quantity'])"> 
Avatar
Buang
Jawaban Terbai

There is a much easier way to change this in Odoo 8.

Go to Settings -> Technical -> Decimal Accuracy -> Product UoS (aka Product Quantity) -> *Change Digits to 0

This solution also pulls through to reports/PDF

Avatar
Buang

I agree. Much better to do it in Odoo config which will pull through the entire system.

Jawaban Terbai

I found the answer. It's working fine.

<span t-esc="'%.0f'%(l.quantity)"/>

Avatar
Buang
Jawaban Terbai

In Odoo 11.0 it will be :

<span t-esc="'%.0f'% l.quantity "/>
Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
3
Des 24
4863
2
Jun 23
4684
0
Mar 22
2539
0
Agu 21
5227
0
Apr 18
8694