From 3157a06762e6a4eb5e7f32a2a8946433495f3ab2 Mon Sep 17 00:00:00 2001 From: Xavier ALT Date: Fri, 27 Apr 2012 10:30:59 +0200 Subject: [PATCH] [FIX] share: fix error on user creation, missing 'company_ids' raising constraint ValidationError bzr revid: xal@openerp.com-20120427083059-bziyfqba9la31sx8 --- addons/share/wizard/share_wizard.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/share/wizard/share_wizard.py b/addons/share/wizard/share_wizard.py index 09fb43ca361..cd6b0c50950 100644 --- a/addons/share/wizard/share_wizard.py +++ b/addons/share/wizard/share_wizard.py @@ -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,