from openerp import models, fields, apifrom openerp.exceptions import ValidationError class
HelloWorld(models.Model):
_name = 'helloworld.test' name = fields.Char("Name", required=True, size=20)
value = fields.Integer("Value", required=True)
@api.onchange('value')
def _onchange_value(self): for record in self:
if record.value < 20:
raise ValidationError("Your record is too small: %s" % record.value)
in field Value i need that minimum integer would be 20.. but i still can save with any value. what is wrong with this?