[FIX] share: fix error on user creation, missing 'company_ids' raising constraint ValidationError

bzr revid: xal@openerp.com-20120427083059-bziyfqba9la31sx8
This commit is contained in:
Xavier ALT 2012-04-27 10:30:59 +02:00
parent 11eb884cb6
commit 3157a06762
1 changed files with 6 additions and 2 deletions

View File

@ -216,6 +216,8 @@ class share_wizard(osv.osv_memory):
for the password field, so they can receive it by email.
Returns the ids of the created users, and the ids of the
ignored, existing ones."""
if context is None:
context = {}
user_obj = self.pool.get('res.users')
current_user = user_obj.browse(cr, UID_ROOT, uid, context=context)
# modify context to disable shortcuts when creating share users
@ -243,7 +245,8 @@ class share_wizard(osv.osv_memory):
'user_email': new_user,
'groups_id': [(6,0,[group_id])],
'share': True,
'company_id': current_user.company_id.id
'company_id': current_user.company_id.id,
'company_ids': [(6, 0, [current_user.company_id.id])],
}, context)
new_line = { 'user_id': user_id,
'password': new_pass,
@ -261,7 +264,8 @@ class share_wizard(osv.osv_memory):
'groups_id': [(6,0,[group_id])],
'share': True,
'menu_tips' : False,
'company_id': current_user.company_id.id
'company_id': current_user.company_id.id,
'company_ids': [(6, 0, [current_user.company_id.id])],
}, context)
new_line = { 'user_id': user_id,
'password': new_pass,