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

Just an example: An employee have some private information. An employee can see his own private information. But should not see other employee private information. In that case we can use attrs = "{'invisible': []}". It can invisible from view. But it's not secure. it's actually eye wash. if we inspect browser & go to Network-> XHR-> read-> JSON response, got the other employee private information. it's the problem of odoo security. there have any other solution for form view of odoo. It'll be helpful for us.

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

Hi,

Try like below.

<record id="hr_personal_rule" model="ir.rule">
<field name="name">Employee</field>
<field ref="hr.model_hr_employee" name="model_id"/>
<field name="domain_force">[('user_id','=',user.id)]</field>
<field name="groups" eval="[(4, ref('group_name'))]"/>
</record>



if you want to show some fields in employee records to only a particular group of users, you can use the group attribute along with that field.

<field name="location_id" groups="group_name"/>

 

 

Regards

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 12 24
694
0
thg 4 22
3524
0
thg 5 18
4307
V17 Tree, Form view Đã xử lý
1
thg 3 25
1296
1
thg 6 24
2677