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:
- CRM
- e-Commerce
- Akuntansi
- Inventaris
- PoS
- Project
- MRP
Pertanyaan ini telah diberikan tanda
2
Replies
11886
Tampilan
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")
Menikmati diskusi? Jangan hanya membaca, ikuti!
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
Daftar| Post Terkait | Replies | Tampilan | Aktivitas | |
|---|---|---|---|---|
|
|
0
Des 25
|
410 | ||
|
|
0
Nov 25
|
405 | ||
|
|
1
Jul 25
|
2294 | ||
|
|
5
Nov 25
|
20393 | ||
|
|
0
Apr 25
|
2009 |