What is wrong with following code in Python?
问题 I was trying to implement a constraint for a field but instead of causing a constraint validation, it allows the record to get saved without showing any constraint message def _check_contact_number(self, cr, uid, ids, context=None): for rec in self.browse(cr, uid, ids, context=context): if rec.contact_number: size=len(str(rec.contact_number)) if size<10: return False if not contact_number: return {} contact_number = rec.contact_number.replace('.','') #removes any '.' from the string contact