i would like to create an integer field which gets the contact number of the customer (Example : 10 digit).. the value enterned in that integer field must be a 10 digit number not more or less than 10digits else it should shown an error message.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project
- MRP
This question has been flagged
1
Reply
5659
Views
def _check_length(self, cr, uid, ids, context=None):
for record in self.browse(cr, uid, ids, context=context):
if len(record.contact)=10:
return True
return False
_constraints = [
(_check_length, 'Length must be equal to 10 digit, ['contact']),
]
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up