From 0980294c2520e5990b53164d0ed7351f19a2fec1 Mon Sep 17 00:00:00 2001 From: Samir Ladoui Date: Tue, 4 Mar 2025 14:09:50 +0100 Subject: [PATCH] [FIX] partner_custom: saudi phone 10 numbers --- odex25_base/partner_custom/models/models.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/odex25_base/partner_custom/models/models.py b/odex25_base/partner_custom/models/models.py index 698b6e85e..5246ba7e3 100644 --- a/odex25_base/partner_custom/models/models.py +++ b/odex25_base/partner_custom/models/models.py @@ -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) != 10: + raise ValidationError(_("The phone number must contain exactly 10 digits and no letters or symbols.")) @api.constrains('email')