[FIX] auth_signup: upon signup of new user, the company_id[s] of the corresponding partner must be used

The default was to use those of the template user,
which may not be correct in multi-company cases.

bzr revid: odo@openerp.com-20130415173901-sevyy27244m6iks0
This commit is contained in:
Olivier Dony
2013-04-15 19:39:01 +02:00
parent 0110522b68
commit 05d0c3cb48
+3
View File
@@ -200,6 +200,9 @@ class res_users(osv.Model):
'partner_id': partner.id,
'email': values.get('email') or values.get('login'),
})
if partner.company_id:
values['company_id'] = partner.company_id.id
values['company_ids'] = [(6,0,[partner.company_id.id])]
self._signup_create_user(cr, uid, values, context=context)
else:
# no token, sign up an external user