Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
3961 Visualizzazioni

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.

Avatar
Abbandona
Risposta migliore

just add the attrs in field from XML side:



                
                
                
                
Avatar
Abbandona
Autore

Thanks for your reply.

Autore

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?

Post correlati Risposte Visualizzazioni Attività
1
nov 22
2154
1
ago 24
8514
5
apr 17
16000
0
feb 25
4343
1
mar 15
7273