[MERGE] lp:~openerp-dev/openobject-addons/trunk-remove-warnings-server-installation-email-tch

bzr revid: jam@tinyerp.com-20120911100005-onjsu8q8rd4yez0c
This commit is contained in:
Jigar Amin - OpenERP
2012-09-11 15:30:05 +05:30
parent 96a7eb3d48
commit e5b41a4329
@@ -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