跳至內容
選單
此問題已被標幟
2 回覆
7152 瀏覽次數

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?



頭像
捨棄
作者

Thank you Mohammed! The record rule works as expected.

最佳答案

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])]


頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
1月 21
3129
5
9月 20
12806
1
6月 24
11977
1
3月 15
5277
2
3月 15
7479