[FIX] res_company,res_user: corrected context for filtering user companies
lp bug: https://launchpad.net/bugs/683643 fixed bzr revid: odo@openerp.com-20101230041832-i231u1lkzvas3bzp
This commit is contained in:
parent
cb93fbf97b
commit
3c4cdab9f2
|
@ -108,7 +108,7 @@
|
|||
<notebook colspan="4">
|
||||
<page string="Current Activity">
|
||||
<field name="company_id" widget="selection" readonly="0"
|
||||
context="{'user_id': self, 'user_preference': 1}" groups="base.group_multi_company"
|
||||
groups="base.group_multi_company"
|
||||
on_change="on_change_company_id(company_id)" />
|
||||
<field name="view" readonly="0"/>
|
||||
<label string="" colspan="2"/>
|
||||
|
@ -146,7 +146,7 @@
|
|||
<group colspan="1" col="2">
|
||||
<separator string="Contact" colspan="2"/>
|
||||
<field name="company_id" required="1"
|
||||
context="{'user_id': self, 'user_preference': 1}"
|
||||
context="{'user_preference': 0}"
|
||||
groups="base.group_multi_company"
|
||||
/>
|
||||
<field name="address_id"/>
|
||||
|
|
|
@ -98,13 +98,7 @@ class res_company(osv.osv):
|
|||
context = {}
|
||||
user_preference = context.get('user_preference', False)
|
||||
if user_preference:
|
||||
# TODO: improve this as soon as the client sends the proper
|
||||
# combination of active_id and active_model we'll be able to
|
||||
# use active_id here to restrict to the user being modified instead
|
||||
# of current user.
|
||||
user_id = context.get('user_id', uid)
|
||||
|
||||
user = self.pool.get('res.users').browse(cr, uid, user_id, context=context)
|
||||
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
|
||||
cmp_ids = list(set([user.company_id.id] + [cmp.id for cmp in user.company_ids]))
|
||||
return cmp_ids
|
||||
return super(res_company, self)._search(cr, uid, args, offset=offset, limit=limit, order=order,
|
||||
|
|
Loading…
Reference in New Issue