+ def _check_year(self, cr, uid, ids, context=None):
+ obj = self.browse(cr, uid, ids[0], context=context)
+ if obj.year:
+ if obj.year < 1900 or obj.year > 2100:
+ return False
+ return True
+
+ _constraints = [
+ (_check_year, 'Error: this year is not valid.', ['year']),
+ ]
+
+