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

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?

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

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'])
Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 12 23
91010
3
thg 9 21
5103
1
thg 6 19
7650
11
thg 9 16
19590
1
thg 9 15
8947