[FIX] res.users: proper multicompany record rule for users, courtesy of Valentin Lab

Contrary to regular records, the company_id field
on res_users does not represent a permanent
relationship, this field is rather used by the
user to select the 'company context' in which
she would like to work.
We don't want the list of assignable users on
a task to change depending on which company
these users are currently viewing data, for
example.
The real field that holds the list of companies
a user belongs to is the 'company_ids' field.

lp bug: https://launchpad.net/bugs/944813 fixed

bzr revid: odo@openerp.com-20120319145216-j1t0d4zjxn9vn058
This commit is contained in:
Olivier Dony
2012-03-19 15:52:16 +01:00
parent 99a12a9216
commit 3f5fb80a76
+2 -2
View File
@@ -35,8 +35,8 @@
<field name="name">user rule</field>
<field model="ir.model" name="model_id" ref="model_res_users"/>
<field eval="True" name="global"/>
<field name="domain_force">['|',('company_id.child_ids','child_of',[user.company_id.id]),('company_id','child_of',[user.company_id.id])]</field>
<field name="domain_force">[('company_ids','child_of',[user.company_id.id])]</field>
</record>
</data>
</data>
</openerp>