[IMP] auth_signup: change reset_password to no_reset_password context value

bzr revid: chm@openerp.com-20130410130244-3ef6mpw6s09xjn75
This commit is contained in:
Christophe Matthieu
2013-04-10 15:02:44 +02:00
parent 81249ef59f
commit 177f51cb54
4 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -268,7 +268,7 @@ class res_users(osv.Model):
# overridden to automatically invite user to sign up
user_id = super(res_users, self).create(cr, uid, values, context=context)
user = self.browse(cr, uid, user_id, context=context)
if context and context.get('reset_password') and user.email:
if user.email and (not context or not context.get('no_reset_password')):
ctx = dict(context, create_user=True)
self.action_reset_password(cr, uid, [user.id], context=ctx)
return user_id
+1 -1
View File
@@ -172,7 +172,7 @@ class wizard_user(osv.osv_memory):
@return: browse record of model res.users
"""
res_users = self.pool.get('res.users')
create_context = dict(context or {}, noshortcut=True) # to prevent shortcut creation
create_context = dict(context or {}, noshortcut=True, no_reset_password=True) # to prevent shortcut creation
values = {
'login': extract_email(wizard_user.email),
'partner_id': wizard_user.partner_id.id,
+1
View File
@@ -230,6 +230,7 @@ class share_wizard(osv.TransientModel):
current_user = user_obj.browse(cr, UID_ROOT, uid, context=context)
# modify context to disable shortcuts when creating share users
context['noshortcut'] = True
context['no_reset_password'] = True
created_ids = []
existing_ids = []
if wizard_data.user_type == 'emails':
@@ -190,7 +190,7 @@ Thanks,''') % (name, self.pool.get('ir.config_parameter').get_param(cr, uid, 'we
'action_id': act_id[0],
'survey_id': [[6, 0, survey_ids]]
}
user = user_ref.create(cr, uid, res_data)
user = user_ref.create(cr, uid, res_data, {'no_reset_password': True})
if user not in new_user:
new_user.append(user)
created+= "- %s (Login: %s, Password: %s)\n" % (partner.name or _('Unknown'),\