Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
5 Odpovědi
11790 Zobrazení

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
Zrušit
Autor Nejlepší odpověď

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
Zrušit
Nejlepší odpověď

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
Zrušit

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

Nejlepší odpověď

I found the answer. It's working fine.

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

Avatar
Zrušit
Nejlepší odpověď

In Odoo 11.0 it will be :

<span t-esc="'%.0f'% l.quantity "/>
Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
3
pro 24
4569
2
čvn 23
4404
0
bře 22
2383
0
srp 21
5033
0
dub 18
8510