Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
7147 Представления

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


Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
янв. 21
3120
5
сент. 20
12794
1
июн. 24
11971
1
мар. 15
5269
2
мар. 15
7465