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:
|
if existing_id:
|
||||||
raise ValidationError(_("ID number must be unique."))
|
raise ValidationError(_("ID number must be unique."))
|
||||||
|
|
||||||
@api.constrains('mobile')
|
# @api.constrains('mobile')
|
||||||
def _check_mobile_format(self):
|
# def _check_mobile_format(self):
|
||||||
print("Test constraint running!")
|
# print("Test constraint running!")
|
||||||
for record in self:
|
# for record in self:
|
||||||
print("Checking mobile format: %s", record.mobile)
|
# print("Checking mobile format: %s", record.mobile)
|
||||||
if record.mobile and (len(record.mobile) != 10 or not record.mobile.isdigit()):
|
# if record.mobile and (len(record.mobile) != 10 or not record.mobile.isdigit()):
|
||||||
raise ValidationError(_("Mobile number must be exactly 10 digits."))
|
# raise ValidationError(_("Mobile number must be exactly 10 digits."))
|
||||||
|
|
||||||
|
|
||||||
# Optional: Add SQL constraints for uniqueness
|
# Optional: Add SQL constraints for uniqueness
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue