Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
7133 Vizualizări

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?



Imagine profil
Abandonează
Autor

Thank you Mohammed! The record rule works as expected.

Cel mai bun răspuns

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


Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
ian. 21
3116
5
sept. 20
12791
1
iun. 24
11949
1
mar. 15
5245
2
mar. 15
7458