Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4044 มุมมอง

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

อวตาร
ละทิ้ง

Look in you openerp-server.log. (the error is probably described in it)

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
มี.ค. 15
3909
2
มิ.ย. 23
2537
0
ส.ค. 16
5388
0
มี.ค. 15
3964
1
มี.ค. 15
6544