[FIX] res_users: fixed on_change_login that crashed

when changing the login by a void value.

bzr revid: tde@openerp.com-20140304111452-np9537a3ja7vf1zi
This commit is contained in:
Thibault Delavallée 2014-03-04 12:14:52 +01:00
parent 257df67d32
commit d6aeff2989
1 changed files with 3 additions and 2 deletions

View File

@ -167,8 +167,9 @@ class res_users(osv.osv):
}
def on_change_login(self, cr, uid, ids, login, context=None):
v = {'email': login} if tools.single_email_re.match(login) else {}
return {'value': v}
if login and tools.single_email_re.match(login):
return {'value': {'email': login}}
return {}
def on_change_company_id(self, cr, uid, ids, company_id):
return {'warning' : {