Skip to Content
Menu
This question has been flagged
2 Replies
1961 Views

hi,,i have a form on which user is to enter his/her email,,,i want to add the restricvtion so that user can not enter and save incorrect email,,,

Avatar
Discard
Best Answer

Hi,

There is a free module for validating the email in Odoo store, the module is of v10. See: Validate E-mail ID

Either you can use the module as such or refer the code and see how it is done. From the index file of the above module, you can see the python packages used for the module, you can try directly using those python packages also.

Python Packages:  validate_email and pyDNS

Thanks

Avatar
Discard
Best Answer

Try regular expression in email field like:

regex = '^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$'V

else raise Validation Error in py

Avatar
Discard