Merge pull request #2532 from expsa/manar_dev_base_2_03

UPDATE partner_custom
This commit is contained in:
Manar416 2025-03-02 13:44:55 +02:00 committed by GitHub
commit 8053566108
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 6 deletions

View File

@ -46,12 +46,12 @@ class ResPartner(models.Model):
if date.today() >= each.identification_expiry_date:
raise Warning(_("Error, the expiry date must be greater than the date of the day"))
@api.constrains('phone')
def _check_phone_length_and_digits(self):
for record in self:
if record.phone:
if not record.phone.isdigit() or len(record.phone) != 7:
raise ValidationError(_("The phone number must contain exactly 7 digits and no letters or symbols."))
# @api.constrains('phone')
# def _check_phone_length_and_digits(self):
# for record in self:
# if record.phone:
# if not record.phone.isdigit() or len(record.phone) != 7:
# raise ValidationError(_("The phone number must contain exactly 7 digits and no letters or symbols."))
@api.constrains('email')