[FIX] Fixed share root url with direct access of user.
bzr revid: vda@tinyerp.com-20101122063823-suc6cj5k8cu7y7ac
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user