跳至內容
選單
此問題已被標幟
2 回覆
2234 瀏覽次數

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,,,

頭像
捨棄
最佳答案

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

頭像
捨棄
最佳答案

Try regular expression in email field like:

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

else raise Validation Error in py

頭像
捨棄