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

I am tring to set a field required  if I set another field such as a check box True.

I searched a lot but got no idea, the attribute required seems like not able to be set like compute, using a function.

Could anybody tell me the idea to achieve this, Thank you.

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

just add the attrs in field from XML side:



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

Thanks for your reply.

Tác giả

I have another question, how to set the field invisible in a one2many field,like:
<field name='condition_field' />
<field name='one2many_field'>
<tree>
<field name='field1' / >
<field name='field2' / attrs={'invisible':[('condition', '=' , True or Condition)]}>
</tree>
</field>
I tried to set the field like this, but fail.
And then set the attrs={'invisible':[('field1','=', True or Condition)]}
It just set the field unclickable on the condition, seems like it verifies on every field and change state for fields that meet the condition, not every field.
Do you have any clue? Thank you.

Can you please specify the fields and their types so I can help?

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 11 22
2191
1
thg 8 24
8547
5
thg 4 17
16028
0
thg 2 25
4369
1
thg 3 15
7316