how to achieve email validation in openerp 7.0 and what is the use of widget="email"
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
7294
Tampilan
In .py file write this method..........
import re
def ValidateEmail(self, cr, uid, ids, email):
if re.match("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$", email) != None:
return True
else:
raise osv.except_osv('Invalid Email', 'Please enter a valid email address')
In view.xml file write this line
<field name="email" on_change="ValidateEmail(email)"/>
@ Akki Modi
You should add a condition when the field email is empty, because onchange methods are executed even during a record creation, so when it find it null, because you have not filled values yet, the onchange method will return an error !
Menikmati diskusi? Jangan hanya membaca, ikuti!
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
DaftarPost Terkait | Replies | Tampilan | Aktivitas | |
---|---|---|---|---|
|
0
Agu 19
|
2613 | ||
How to send email on stock picking validate button
Diselesaikan
|
|
4
Jul 20
|
5998 | |
|
1
Jul 25
|
1056 | ||
|
5
Mei 25
|
18495 | ||
|
0
Apr 25
|
1212 |