Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
7162 Weergaven

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
Annuleer
Auteur

Thank you Mohammed! The record rule works as expected.

Beste antwoord

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
jan. 21
3148
5
sep. 20
12810
1
jun. 24
11980
1
mrt. 15
5280
2
mrt. 15
7484