From aae980b458f6f8807e2dd5d6122d33a7b2c21480 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Tue, 10 Nov 2015 10:35:23 +0100 Subject: [PATCH] [FIX] auth_signup: initial invitation link should not expire --- addons/auth_signup/res_users.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/addons/auth_signup/res_users.py b/addons/auth_signup/res_users.py index eab3fbe9877..4b99259a8a9 100644 --- a/addons/auth_signup/res_users.py +++ b/addons/auth_signup/res_users.py @@ -256,16 +256,21 @@ class res_users(osv.Model): def action_reset_password(self, cr, uid, ids, context=None): """ create signup token for each user, and send their signup url by email """ # prepare reset password signup + create_mode = bool(context.get('create_user')) res_partner = self.pool.get('res.partner') partner_ids = [user.partner_id.id for user in self.browse(cr, uid, ids, context)] - res_partner.signup_prepare(cr, uid, partner_ids, signup_type="reset", expiration=now(days=+1), context=context) + + # no time limit for initial invitation, only for reset password + expiration = False if create_mode else now(days=+1) + + res_partner.signup_prepare(cr, uid, partner_ids, signup_type="reset", expiration=expiration, context=context) if not context: context = {} # send email to users with their signup url template = False - if context.get('create_user'): + if create_mode: try: # get_object() raises ValueError if record does not exist template = self.pool.get('ir.model.data').get_object(cr, uid, 'auth_signup', 'set_password_email')