<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"/>
<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"/>
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,