Odoo Help

1

Limit the number of digits in integer?

By
Wolfgang Pelser
on 7/2/14, 3:32 AM 9,373 views

Is there a way to limit number of digits in integer in OpenERP like you can in char type? I need field that would only let you enter max two digits.

For example with char, you can do this:

'char_field': fields.char(size=2),

Then if you try to enter more than two symbols, it won't write it.

But if I create integer field:

'integer_field': fields.integer(),

It will let me write any number of digits I want.

Thanks Atul It's an easy solution..

Wolfgang Pelser
on 7/2/14, 3:36 AM
7

Atul Arvind

--Atul Arvind--
2058
| 3 3 5
vadodara, India
--Atul Arvind--

Hello, 

I am odoo Enthusiast/Developer from Vadodara, India. Working with odoo from v5 to v11 and other opensource technology since 5+ years. Having Strong Expertise in

Odoo Development

Odoo Customization

Odoo Training

Odoo Integration

Server Administration

Odoo Migration

Implementation

Here is my StackOverflow profile.  you can also find me on LinkedIn.


Contact: atul.surficle@gmail.com.



Atul Arvind
On 7/2/14, 3:33 AM

You can use a _constraint to check the value of your integer and raise an exception if it is not in your desired range.

Check this blog post about how to create a constraint.

3

René Schuster

--René Schuster--
1663
| 5 5 8
Weinheim, Germany
--René Schuster--

Challenge Everything!

René Schuster
On 7/2/14, 3:40 AM

The size attribute is also availbe for integer fields!

'integer_field': fields.integer('My Integer', size=4),

 

Regards.

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.

Register

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)

Stats

Asked: 7/2/14, 3:32 AM
Seen: 9373 times
Last updated: 7/27/17, 2:58 AM