Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
2897 Lượt xem

I have this message:

The requested operation can not be completed due to security restrictions. Document type: Employee (hr.employee) Operation: read User: 23 Fields: - contract_id (allowed for groups 'Employees / Officer')


I would not like to add the user to the mentioned group because I want to restrict his actions, and this group has too many permissions. How can I know what permission is required for that specific field?


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Relation fields have the permissions of the related model, not the model you are loading in the form, so you have permissions on table A, and relation with table B but no access to the records of table B. try removing the field, or adding a group rule to stop unauthorized people form seeing it, as tommaso already suggested.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

As the restriction is at field level (contract_id) , it will be possibly because of a record rule defined on that field and model. 

In order to confirm the same in your example, enable the developer mode, go to settings , technical menu and open record rules. Here, filter for the model hr. employee

Check the rules in tree view which contain the field name contract_id (domain column) and check the rule definition of that particular record rule. If the groups defined for this rule doesn't contain the group of the user for whom the error is coming, then, this particular record rule will be the reason why you are getting that error. 



Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Try limiting the field view to that group with the attribute `groups`. XML Field Documentation.

<field name="contract_id" groups="hr.hr_group_manager" />



                
                
Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 8 23
3981
1
thg 10 22
3481
0
thg 9 22
1936
1
thg 9 22
3340
1
thg 6 25
1702