How to validate email entered in odoo10?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- إدارة علاقات العملاء
- e-Commerce
- المحاسبة
- المخزون
- PoS
- المشروع
- MRP
لقد تم الإبلاغ عن هذا السؤال
2
الردود
13153
أدوات العرض
Hi , you can use below code to validate email Id:-
import re
from odoo.exceptions import ValidationError
@api.onchange('email_id')
def validate_mail(self):
if self.email_id:
match = re.match('^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$', self.email_id)
if match == None:
raise ValidationError('Not a valid E-mail ID')
Working thanks
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيل
Wrong question asked, this question is not related to odoo, this is python related question. you may find the answer for this question on stack overflow. there are many examples available for this question on stack overflow. Please ask only odoo related question here, otherwise your question would be downgraded.