Merge pull request #2574 from expsa/samir-aladawi-fix-phone-number
[FIX] partner_custom: saudi phone 10 numbers
This commit is contained in:
commit
d283199613
|
|
@ -46,12 +46,12 @@ class ResPartner(models.Model):
|
||||||
if date.today() >= each.identification_expiry_date:
|
if date.today() >= each.identification_expiry_date:
|
||||||
raise Warning(_("Error, the expiry date must be greater than the date of the day"))
|
raise Warning(_("Error, the expiry date must be greater than the date of the day"))
|
||||||
|
|
||||||
# @api.constrains('phone')
|
@api.constrains('phone')
|
||||||
# def _check_phone_length_and_digits(self):
|
def _check_phone_length_and_digits(self):
|
||||||
# for record in self:
|
for record in self:
|
||||||
# if record.phone:
|
if record.phone:
|
||||||
# if not record.phone.isdigit() or len(record.phone) != 7:
|
if not record.phone.isdigit() or len(record.phone) != 10:
|
||||||
# raise ValidationError(_("The phone number must contain exactly 7 digits and no letters or symbols."))
|
raise ValidationError(_("The phone number must contain exactly 10 digits and no letters or symbols."))
|
||||||
|
|
||||||
|
|
||||||
@api.constrains('email')
|
@api.constrains('email')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue