hi ,
i want to validate my field email , i want to get a popup error before saving the forum not after
and thx for help :)
def validate_mail(self):
if self.email:
match = re.match('^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$', self.email)
if match == None:
raise ValidationError('Not a valid E-mail ID')
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- सीआरएम
- e-Commerce
- लेखांकन
- इन्वेंटरी
- PoS
- प्रोजेक्ट
- MRP
This question has been flagged
2
Replies
11902
Views
Hi,
Just go through this module for Validating the E-mail ID and see how it is done: https://apps.odoo.com/apps/modules/10.0/email_id_validation/
Thanks
if not re.match('(\w+[.|\w])*@(\w+[.])*\w+', record.mail):
raise exceptions.ValidationError("Wrong mail")
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up| Related Posts | Replies | Views | Activity | |
|---|---|---|---|---|
|
|
0
दिस॰ 25
|
410 | ||
|
|
0
नव॰ 25
|
420 | ||
|
|
1
जुल॰ 25
|
2311 | ||
|
|
5
नव॰ 25
|
20430 | ||
|
|
0
अप्रैल 25
|
2026 |