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:
- ลูกค้าสัมพันธ์
- e-Commerce
- ระบบบัญชี
- สินค้าคงคลัง
- PoS
- Project
- MRP
คำถามนี้ถูกตั้งค่าสถานะ
2
ตอบกลับ
7301
มุมมอง
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 !
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อRelated Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
---|---|---|---|---|
|
0
ส.ค. 19
|
2613 | ||
|
4
ก.ค. 20
|
5998 | ||
|
1
ก.ค. 25
|
1059 | ||
|
5
พ.ค. 25
|
18504 | ||
|
0
เม.ย. 25
|
1215 |