Merge pull request #3144 from expsa/Esraa-ensan-sale_tasks
stop mobile constrain
This commit is contained in:
commit
1e755821d6
|
|
@ -199,13 +199,13 @@ class Partner(models.Model):
|
|||
if existing_id:
|
||||
raise ValidationError(_("ID number must be unique."))
|
||||
|
||||
@api.constrains('mobile')
|
||||
def _check_mobile_format(self):
|
||||
print("Test constraint running!")
|
||||
for record in self:
|
||||
print("Checking mobile format: %s", record.mobile)
|
||||
if record.mobile and (len(record.mobile) != 10 or not record.mobile.isdigit()):
|
||||
raise ValidationError(_("Mobile number must be exactly 10 digits."))
|
||||
# @api.constrains('mobile')
|
||||
# def _check_mobile_format(self):
|
||||
# print("Test constraint running!")
|
||||
# for record in self:
|
||||
# print("Checking mobile format: %s", record.mobile)
|
||||
# if record.mobile and (len(record.mobile) != 10 or not record.mobile.isdigit()):
|
||||
# raise ValidationError(_("Mobile number must be exactly 10 digits."))
|
||||
|
||||
|
||||
# Optional: Add SQL constraints for uniqueness
|
||||
|
|
|
|||
Loading…
Reference in New Issue