From 00eb6837dd913841f28bcf545bcd82563b6a3dfc Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 13 Mar 2013 17:20:45 +0100 Subject: [PATCH 1/6] [ADD] Added res.users auth_signup infobox for reset password bzr revid: fme@openerp.com-20130313162045-zuzl2p2ooijjmvl6 --- addons/auth_signup/res_users.py | 1 + addons/auth_signup/res_users_view.xml | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/addons/auth_signup/res_users.py b/addons/auth_signup/res_users.py index 9718897ef82..bc8028f2f5a 100644 --- a/addons/auth_signup/res_users.py +++ b/addons/auth_signup/res_users.py @@ -169,6 +169,7 @@ class res_users(osv.Model): _columns = { 'state': fields.function(_get_state, string='Status', type='selection', selection=[('new', 'New'), ('active', 'Active'), ('reset', 'Resetting Password')]), + 'signup_url': fields.related('partner_id', 'signup_url', type='char', string='Reset password', readonly=True), } def signup(self, cr, uid, values, token=None, context=None): diff --git a/addons/auth_signup/res_users_view.xml b/addons/auth_signup/res_users_view.xml index be9942feac2..cb1ba207c9a 100644 --- a/addons/auth_signup/res_users_view.xml +++ b/addons/auth_signup/res_users_view.xml @@ -17,6 +17,10 @@
+
+

This user received a link in order to reset his password.

+

(this will log you out)

+
From 38e9b66af9f2e7e62f212bb3b87fc183505e6621 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 13 Mar 2013 17:26:51 +0100 Subject: [PATCH 2/6] [REM] Removed reset_password notification bzr revid: fme@openerp.com-20130313162651-614fv1kefo46jszw --- addons/auth_signup/res_users.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/addons/auth_signup/res_users.py b/addons/auth_signup/res_users.py index bc8028f2f5a..e577482f33e 100644 --- a/addons/auth_signup/res_users.py +++ b/addons/auth_signup/res_users.py @@ -269,16 +269,7 @@ class res_users(osv.Model): 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: - 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 link' % user.partner_id.signup_url, - 'sticky': True, - } - } + return True def create(self, cr, uid, values, context=None): # overridden to automatically invite user to sign up From 3c8dbf0ad5ba2dff74d9848febdca69604243adc Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 14 Mar 2013 12:50:28 +0100 Subject: [PATCH 3/6] [FIX] Fixed infobox attrs bzr revid: fme@openerp.com-20130314115028-f2x6is15jmicaumc --- addons/auth_signup/res_users.py | 3 +-- addons/auth_signup/res_users_view.xml | 12 +++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/addons/auth_signup/res_users.py b/addons/auth_signup/res_users.py index e577482f33e..3c29788e1eb 100644 --- a/addons/auth_signup/res_users.py +++ b/addons/auth_signup/res_users.py @@ -161,7 +161,7 @@ class res_users(osv.Model): def _get_state(self, cr, uid, ids, name, arg, context=None): res = {} for user in self.browse(cr, uid, ids, context): - res[user.id] = ('reset' if user.signup_valid else + res[user.id] = ('reset' if user.signup_valid and user.login_date else 'active' if user.login_date else 'new') return res @@ -169,7 +169,6 @@ class res_users(osv.Model): _columns = { 'state': fields.function(_get_state, string='Status', type='selection', selection=[('new', 'New'), ('active', 'Active'), ('reset', 'Resetting Password')]), - 'signup_url': fields.related('partner_id', 'signup_url', type='char', string='Reset password', readonly=True), } def signup(self, cr, uid, values, token=None, context=None): diff --git a/addons/auth_signup/res_users_view.xml b/addons/auth_signup/res_users_view.xml index cb1ba207c9a..4ff7ee7afc0 100644 --- a/addons/auth_signup/res_users_view.xml +++ b/addons/auth_signup/res_users_view.xml @@ -17,9 +17,15 @@
-
-

This user received a link in order to reset his password.

-

(this will log you out)

+
+

+ This user received the following link in order to reset his password. +

+

+ This user has been invited with the following link. +

+

(this link will log you out)

+
From 4b556f625e149379fa6f3e731e23fadac30a1036 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 14 Mar 2013 16:40:03 +0100 Subject: [PATCH 4/6] [IMP] res_users info box change wording bzr revid: fme@openerp.com-20130314154003-r15yz1gvy324vz36 --- addons/auth_signup/res_users_view.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/auth_signup/res_users_view.xml b/addons/auth_signup/res_users_view.xml index 4ff7ee7afc0..ea2efc7a875 100644 --- a/addons/auth_signup/res_users_view.xml +++ b/addons/auth_signup/res_users_view.xml @@ -19,12 +19,12 @@

- This user received the following link in order to reset his password. + A password reset has been requested for this user. An email containing the following link has been sent:

- This user has been invited with the following link. + This user has not logged in yet. An invitation email has been sent with the following subscription link:

-

(this link will log you out)

+

@@ -33,6 +33,7 @@
From 659c5f00590c8813e48e70573b2e2be1f67a582a Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 14 Mar 2013 17:01:41 +0100 Subject: [PATCH 5/6] [REM] Removed one state bzr revid: fme@openerp.com-20130314160141-5hrurkcy4w3wc4ca --- addons/auth_signup/res_users.py | 6 ++---- addons/auth_signup/res_users_view.xml | 15 +++++++++------ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/addons/auth_signup/res_users.py b/addons/auth_signup/res_users.py index 74bda08cb0b..8d717ece113 100644 --- a/addons/auth_signup/res_users.py +++ b/addons/auth_signup/res_users.py @@ -161,14 +161,12 @@ class res_users(osv.Model): def _get_state(self, cr, uid, ids, name, arg, context=None): res = {} for user in self.browse(cr, uid, ids, context): - res[user.id] = ('reset' if user.signup_valid and user.login_date else - 'active' if user.login_date else - 'new') + res[user.id] = ('active' if user.login_date else 'new') return res _columns = { 'state': fields.function(_get_state, string='Status', type='selection', - selection=[('new', 'Never Connected'), ('active', 'Activated'), ('reset', 'Invitation Pending')]), + selection=[('new', 'Never Connected'), ('active', 'Activated')]), } def signup(self, cr, uid, values, token=None, context=None): diff --git a/addons/auth_signup/res_users_view.xml b/addons/auth_signup/res_users_view.xml index ea2efc7a875..156d9f2839a 100644 --- a/addons/auth_signup/res_users_view.xml +++ b/addons/auth_signup/res_users_view.xml @@ -17,12 +17,12 @@
-
-

+

+

A password reset has been requested for this user. An email containing the following link has been sent:

-

- This user has not logged in yet. An invitation email has been sent with the following subscription link: +

+ An invitation email has been sent to this user with the following subscription link:

@@ -32,8 +32,11 @@
From 868075d7ca9df953ff55bd16bbbe3b5ff144a751 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 14 Mar 2013 17:39:13 +0100 Subject: [PATCH 6/6] [FIX] Give correct context for invitatio bzr revid: fme@openerp.com-20130314163913-wteq8qrimxqmro76 --- addons/auth_signup/res_users_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/auth_signup/res_users_view.xml b/addons/auth_signup/res_users_view.xml index 156d9f2839a..7b58c3eb714 100644 --- a/addons/auth_signup/res_users_view.xml +++ b/addons/auth_signup/res_users_view.xml @@ -35,7 +35,7 @@ type="object" name="action_reset_password" attrs="{'invisible': [('state', '!=', 'active')]}"/>