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

base.group_user can edit project.issue in every stage. portal.group_portal can edit SOME fields of the issue only in NEW stage. In two other stages (of all 7) portal user can press buttons Accept or Reject and change the stage value of the issue. I can't limit rights to record, because I need to change the value of the stage. I think I have to limit rights to some fields on the view.xml:

if the user group = portal.group_portal and stage_id != new readonly="1"

How to implement this condition to a single field?

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

add this code in your xml file

 <field name="field_name"  attrs="{'readonly':[('stage_id','!=','new')]}"/>

and in your python file, specify

field_name :  fields.char('Field Label',size=32,read=['portal.group_portal'])
อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
readonly option in fields? แก้ไขแล้ว
3
ธ.ค. 23
91044
3
ก.ย. 21
5123
1
มิ.ย. 19
7687
11
ก.ย. 16
19619
1
ก.ย. 15
8956