diff --git a/addons/share/wizard/share_wizard.py b/addons/share/wizard/share_wizard.py index 4943f6a6e10..bce94c1dc3e 100644 --- a/addons/share/wizard/share_wizard.py +++ b/addons/share/wizard/share_wizard.py @@ -99,12 +99,16 @@ class share_create(osv.osv_memory): for new_user in wizard_data.new_users.split('\n'): # attempt to show more user-friendly msg than default constraint error existing = user_obj.search(cr, 1, [('login', '=', new_user)]) + password = generate_random_pass() + if wizard_data.share_root_url: + wizard_data.share_root_url = wizard_data.share_root_url + '/openerp/login?db=%s'%(cr.dbname) + '&user=%s'%(new_user) + '&password=%s'%(password) + self.write(cr, 1, [uid], {'share_root_url': wizard_data.share_root_url}) if existing: raise osv.except_osv(_('User already exists'), _('This username (%s) already exists, perhaps data has already been shared with this person.\nYou may want to try selecting existing shared users instead.')) user_id = user_obj.create(cr, 1, { 'login': new_user, - 'password': generate_random_pass(), + 'password': password, 'name': new_user, 'user_email': new_user, 'groups_id': [(6,0,[group_id])], @@ -395,7 +399,6 @@ class share_create(osv.osv_memory): # C. all_relations = obj0 + obj1 + obj2 + obj3 self._link_or_copy_current_user_rules(cr, uid, group_id, all_relations, context=context) - # so far, so good -> populate summary results and return them self._create_result_lines(cr, uid, wizard_data, context=context)