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

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.

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

just add the attrs in field from XML side:



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

Thanks for your reply.

ผู้เขียน

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?

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ย. 22
2152
1
ส.ค. 24
8511
5
เม.ย. 17
16000
0
ก.พ. 25
4341
1
มี.ค. 15
7273