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

We have designed and developed a custom addon in Odoo Community v12 regarding building management. There are three types of security groups in our case which are normal building user with only a read right and the building manager and officer with CRUD rights of 1,1,1,0 and 1,1,1,1 respectively. The officer and the manager can attach documents to the Building model through relationship created with ir_attachment table. 

However, we have a situation such that the normal users should not see the attachment added for the building in any of the circumstances (including rpc). If we are to restrict the permissions to ir_attachment then the user cannot see any attachment in any other odoo module. We created a seperate model for keeping building attachments named 'building.attachment' but is this a recommended approach as there is already a table called (ir_attachment) in odoo database that keeps attachments? Beacuse we will develop tens of addons with such case and creating an attachment table for each addon seems to be an inappropriate approach.

We tried to write an access rule for the respective record in ir.attachment to restrict normal users from reaching (ir.model=building) but haven't come across any application that uses such kind of restriction. 

We will be very appreciative if anyone has any idea on solving this problem.


아바타
취소
베스트 답변

Hello Rumeysa,

You need to define record rule with domain i.e,

[('res_model', '!=', 'model.name')]

or if you want to restrict on multiple models you can define by this domain :- 

[('res_model', 'not in', ['model.name1', 'model.name2', ...., 'model.nameN'])]

set Apply for XXX Booleans and groups.


Regards,




Email: odoo@aktivsoftware.com

Skype: kalpeshmaheshwari

   

아바타
취소
관련 게시물 답글 화면 활동
3
6월 23
12816
10
2월 16
9607
0
5월 24
1713
42
4월 23
127522
0
6월 22
3593