Odoo Help


Display a quantity in PDF reports without decimal places (we are always dealing with integer numbers)

on 10/25/15, 6:59 AM 1,527 views

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?

On 10/25/15, 7:37 AM

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'])"> 
Jessica Dowd
On 10/26/15, 2:24 AM

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.

Limitless Virtual Enterprise, Andre de Kock
on 10/26/15, 2:26 AM
Jaydeep Barot (jar)
On 10/26/15, 12:41 AM

I found the answer. It's working fine.

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

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 10/25/15, 6:59 AM
Seen: 1527 times
Last updated: 3/16/16, 7:30 AM