Odoo Help


This community 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.


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

on 10/25/15, 6:59 AM 601 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)"/>

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)


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