From e5b41a4329daae55b0f99ab7afcb8f174f7524d1 Mon Sep 17 00:00:00 2001 From: Jigar Amin - OpenERP Date: Tue, 11 Sep 2012 15:30:05 +0530 Subject: [PATCH] [MERGE] lp:~openerp-dev/openobject-addons/trunk-remove-warnings-server-installation-email-tch bzr revid: jam@tinyerp.com-20120911100005-onjsu8q8rd4yez0c --- addons/auth_reset_password/auth_reset_password.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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