Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
5 Відповіді
11918 Переглядів

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?


Аватар
Відмінити
Автор Найкраща відповідь

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'])"> 
Аватар
Відмінити
Найкраща відповідь

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

Аватар
Відмінити

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

Найкраща відповідь

I found the answer. It's working fine.

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

Аватар
Відмінити
Найкраща відповідь

In Odoo 11.0 it will be :

<span t-esc="'%.0f'% l.quantity "/>
Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
3
груд. 24
4824
2
черв. 23
4628
0
бер. 22
2520
0
серп. 21
5191
0
квіт. 18
8673