I want to create rule that will allow user see other users only if his currently picked company is in other users allowed companies.
For example:
UserA have access to Company1 and Company2.
UserB have access to Company1 and Comapny3.
UserC have access only to Company3.
UserA selected Company1 as his current company.
UserB and UserC selected Company3 as their current company.
In the result UserA should see UserB but not UserC. Because UserA have selected Company1 and UserB have Comapny1 in his allowed companies while UserC does not.
Currently users see only other users that have selected the same current company.
I tried to make rule like this:
[('user.company_id.id', 'in', [c.id for c in company_ids])]
then when I'm tring to open users list or even setting odoo crashes and says that "company_ids is not defined".