diff --git a/addons/auth_reset_password/auth_reset_password.py b/addons/auth_reset_password/auth_reset_password.py index ff208c89b9c..ab61cb3809d 100644 --- a/addons/auth_reset_password/auth_reset_password.py +++ b/addons/auth_reset_password/auth_reset_password.py @@ -32,8 +32,12 @@ def message_check(msg, secret): class res_users(osv.osv): _inherit = 'res.users' + _columns = { + 'email': fields.char('Email', size=240), + } + _sql_constraints = [ - ('email_uniq', 'UNIQUE (user_email)', 'You can not have two users with the same email!') + ('email_uniq', 'UNIQUE (email)', 'You can not have two users with the same email!') ] def _auth_reset_password_secret(self, cr, uid, context=None): @@ -77,7 +81,7 @@ class res_users(osv.osv): MailMessage.send(cr, uid, [msg_id], context=context) def send_reset_password_request(self, cr, uid, email, context=None): - ids = self.pool.get('res.users').search(cr, SUPERUSER_ID, [('user_email', '=', email)], context=context) + ids = self.pool.get('res.users').search(cr, SUPERUSER_ID, [('email', '=', email)], context=context) if ids: self._auth_reset_password_send_email(cr, SUPERUSER_ID, email, 'reset_password_email', ids[0], context=context) return True