콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
7255 화면

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
3192
5
9월 20
12883
1
6월 24
12059
1
3월 15
5362
2
3월 15
7616