跳至内容
菜单
此问题已终结
1 回复
3953 查看

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?

相关帖文 回复 查看 活动
1
11月 22
2148
1
8月 24
8508
5
4月 17
15999
0
2月 25
4339
1
3月 15
7273