Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
3743 Prikazi

Hi, I have a scenario where I need to validate a email address whether it is valid or not. For validating I have used the following code.

hr_view.xml:

<field name="work_email" widget="email" on_change="onchange_work_email(work_email)"/>

hr.py

def onchange_work_email(self, cr, uid, ids, work_email): if re.match("^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$", work_email) != None: return True else: raise osv.except_osv(_('Invalid Email'), _('Please enter a valid email address'))

But I got No handler found error. I made changes in only above two files, Did i need to import regular expressions ? what is the error ? Any appreciate suggestions

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
1
jun. 25
3860
1
sep. 19
10730
3
dec. 23
45913
0
mar. 15
3884
1
dec. 22
3631