Odoo Help


Integer field: to format like "000001", "000002"

on 12/7/14, 1:54 AM 1,147 views

Consider a integer field say "key"...

I want to display the value of key in "000001" format and also to restrict it to 6 digits

So if the value is 5 then it should display as "000005", 6 as "000006", 7 as "000007" etc....

Is there a way to achieve the same....

Abdullah Sofan
On 12/7/14, 2:43 AM

Maybe this will help:


Ya thank you but they have used it to print, converting it to string and using zfill to fill the value... But am looking for integer formatting property to achieve it... If I didn't find any solution will do the same, will create a additional character field and apply that logic... thank you

on 12/7/14, 2:53 AM

well.. INTEGERS do not have leading zeroes.. you shoul cosider using char field , or field function (type=char) that dispays integer with leading zeroes...

on 12/8/14, 4:00 AM

@bole, yup... finally I also did the same :)... thank you

on 12/8/14, 4:24 AM

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 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

1 follower(s)


Asked: 12/7/14, 1:54 AM
Seen: 1147 times
Last updated: 3/16/15, 8:10 AM