İçereği Atla
Menü
Bu soru işaretlendi
5 Cevaplar
11945 Görünümler

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
Vazgeç
Üretici En İyi Yanıt

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
Vazgeç
En İyi Yanıt

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
Vazgeç

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

En İyi Yanıt

I found the answer. It's working fine.

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

Avatar
Vazgeç
En İyi Yanıt

In Odoo 11.0 it will be :

<span t-esc="'%.0f'% l.quantity "/>
Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
3
Ara 24
4853
2
Haz 23
4668
0
Mar 22
2530
0
Ağu 21
5202
0
Nis 18
8689