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

Hi,

Im want to have a field that can only be edited by users of group A, but can be displayed (but not edited / readonly) by users of group B.

How can I achive this in OpenERP? I've tried different methods but all of them completely remove the field for unauthorized groups.

Regards.

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

Hi, you can use this in your py file field...

'name': fields.char('Name', size=128, read=['base.group_userA'], write=['base.group_userB'] )

Read will allow the user group to view and Write will allow the user group to edit the field..

Thanks & if it works accept the answer...

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

Thanks for the answer it works, unauthorized users can still edit the field but the changes are not saved is there a way to make the field completely uneditable?

Try this in your xml file... <field name="name" groups="base.group_userB"/>. Now the userB group only can view the field....

Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 12 23
90516
3
thg 9 21
4846
4
thg 4 25
4502
3
thg 7 23
5511
2
thg 3 22
10324