Skip to Content
Menu
This question has been flagged
2 Replies
6993 Views

Hi all,


I'm trying to filter views based on the allowed companies for a user in a multicompany setup.

  • The python class has a field 'building_owner_id', which is a M2O to res.company

  • I want that a user only sees the records where 'building_owner_id' is in her/his list of allowed companies (so the field 'company_ids' from res.user).

Any suggestions?



Avatar
Discard
Author

Thank you Mohammed! The record rule works as expected.

Best Answer

you can create a record rule for that class which compares the building_owner_id and current user's allowed companies.

use this domain for the record rule:

[('building_owner_id','in',[user.company_ids.ids])]


Avatar
Discard
Related Posts Replies Views Activity
1
Jan 21
2988
5
Sep 20
12542
1
Jun 24
11756
1
Mar 15
5048
2
Mar 15
7226