Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
Hello! Help me on how to constraint a number of characters in a fields.Char?
and number must be minimum of 12 and maximum of 15 characters
here's my models.py
bir_id = fields.Char(size=15)
def _check_length(self, cr, uid, ids, context=None):
for record in self.browse(cr, uid, ids):
if record.bir_id < 12:
_constraints = [(_check_length, 'Error', ['bir_id'])]
when i enter less than 12 characters, there's no error. What do you think is the problem?
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
|Asked: 11/3/15, 11:24 PM|
|Seen: 1135 times|
|Last updated: 11/3/15, 11:59 PM|