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

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
4863
2
июн. 23
4684
0
мар. 22
2539
0
авг. 21
5226
0
апр. 18
8694