Odoo Help

Welcome!

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.

0

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

By
deep
on 12/7/14, 1:54 AM 1,064 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....

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

Maybe this will help:

http://stackoverflow.com/questions/134934/display-number-with-leading-zeros

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

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

Bole
on 12/8/14, 4:00 AM

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

deep
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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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