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

When an employee edits his/her information I want to restrict certain fields not to edit by employee (but can be editable by ADMIN).

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

Hi,

You could use the "read" and "write" attributes on field definition, like this one:

    _columns = {
        'credit_limit': fields.float(string='Credit Limit',
                                     read=['base.group_sale_salesman'],
                                     write=['base.group_sale_manager']),

This will create a field named credit_limit that will be readable by users belonging to base.group_sale_salesman and writable only by base.group_sale_manager users...

Ảnh đại diện
Huỷ bỏ
Tác giả

Hi Mario, Thanks for the reply. It helped me a lot.

Câu trả lời hay nhất

You can apply group on that field.admin exist to that group not user.

like groups="base.group_no_one"

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 8 23
12266
0
thg 11 16
1392
1
thg 3 15
4840
2
thg 3 15
4828
4
thg 10 20
6757