summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvta vta@openerp.com <>2013-01-02 11:18:05 +0100
committervta vta@openerp.com <>2013-01-02 11:18:05 +0100
commit8a27d3d138dfea25b09d891bcbad4fccdd2c718a (patch)
treed5fce685903eec1d4b32fc0bf69974b831d6b6a1
parentfca02afad39a6302de82a6ad0b0d656442ef7241 (diff)
[IMP] Show notification when sending a reset password mail
bzr revid: vta@openerp.com-20130102101805-xnh9ixoo8b3yc14i
-rw-r--r--addons/auth_signup/res_users.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/addons/auth_signup/res_users.py b/addons/auth_signup/res_users.py
index f57fa4cb7ca..5c558ca68d7 100644
--- a/addons/auth_signup/res_users.py
+++ b/addons/auth_signup/res_users.py
@@ -249,14 +249,22 @@ class res_users(osv.Model):
assert template._name == 'email.template'
for user in self.browse(cr, uid, ids, context):
if not user.email:
- m = osv.except_osv(_("Cannot send email: user has no email address."), user.name)
+ raise osv.except_osv(_("Cannot send email: user has no email address."), user.name)
mail_id = self.pool.get('email.template').send_mail(cr, uid, template.id, user.id, True, context=context)
mail_state = mail_obj.read(cr, uid, mail_id, ['state'], context=context)
- if mail_state and mail_state == 'exception':
- m = osv.except_osv(_("Cannot send email: no outgoing email server configured.\nYou can configure it under Settings/General Settings."), user.name)
+ if mail_state and mail_state['state'] == 'exception':
+ raise osv.except_osv(_("Cannot send email: no outgoing email server configured.\nYou can configure it under Settings/General Settings."), user.name)
else:
- m = osv.except_osv(_("Mail sent to:"), user.email)
- return True
+ return {
+ 'type': 'ir.actions.client',
+ 'name': '_(Server Notification)',
+ 'tag': 'action_notify',
+ 'params': {
+ 'title': 'Mail Sent to: %s' % user.name,
+ 'text': 'You can reset the password by yourself using this <a href=%s>link</a>' % user.partner_id.signup_url,
+ 'sticky': True,
+ }
+ }
def create(self, cr, uid, values, context=None):
# overridden to automatically invite user to sign up