[FIX]Minor change
bzr revid: vja@tinyerp.com-20121206122219-tcod9bad69fgr836
This commit is contained in:
@@ -246,7 +246,16 @@ class res_users(osv.Model):
|
||||
for user in self.browse(cr, uid, ids, context):
|
||||
if not user.email:
|
||||
raise osv.except_osv(_("Cannot send email: user has no email address."), user.name)
|
||||
self.pool.get('email.template').send_mail(cr, uid, template.id, user.id, context=context)
|
||||
msg_id = None
|
||||
msg_id = self.pool.get('email.template').send_mail(cr, uid, template.id, user.id, context=context)
|
||||
if not msg_id:
|
||||
raise osv.except_osv(_("The email to reset the password has not been sent. Configure the outgoing server and retry resetting the password"), "")
|
||||
else :
|
||||
warning = {
|
||||
'title': _("Reset Password"),
|
||||
'message': _("An email has been sent to %s, the user will be able to change his password using the link provided in the email. The old password is still valid until the user changes his password.")% user.email
|
||||
}
|
||||
return {'warning':warning}
|
||||
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user