Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
8956 มุมมอง

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.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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...

อวตาร
ละทิ้ง
ผู้เขียน

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....

Related Posts ตอบกลับ มุมมอง กิจกรรม
readonly option in fields? แก้ไขแล้ว
3
ธ.ค. 23
91045
3
ก.ย. 21
5123
4
เม.ย. 25
5346
3
ก.ค. 23
5755
change existing field readonly แก้ไขแล้ว
2
มี.ค. 22
10529