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

I am creating a module for Employee Self Service . I want to achieve 

1) Employee can only view his details . (out of which Employee can only edit  Contact Information )

2) Disable Create that appears in fields dropdown in the form.

how can we achieve such restriction from python class 

class hr_employee(osv.osv):

    _name = "hr.employee"
    _inherit = "hr.employee"
    _description = "Employee"
        

hr_employee()

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

For only viewing your own details, I think the fastest way is to create a view with a fixed domain, for example "[('id','=',uid)]" or something like that. That way, for that view the user will only be able to see his own details.

For each object you want the "create" button to disappear you need to work the access rights for the said user. If he/she has create access rights on for example "hr.employee.contract" object, then in the list it will say "Create". If the user has only read rights, those options will disappear.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 6 21
4156
1
thg 12 23
18332
0
thg 3 15
2859
0
thg 3 15
3779
1
thg 3 15
4849