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

I added two field in the wizard column, like this :


in .py

division = fields.Selection([('Unit','Unit'),('Sparepart','Sparepart'),('Umum','Umum')], 'Division')

chassis_number = fields.Char('Chassis Number')


in .xml

<field name="division"/>

<field name="chassis_number" attrs="{'invisible': [('division','!=','Unit')]}"/>


I need to hide chassis_number field when division is not Unit. And I tried the code like above, but it doesn't work. The effect so as read only. Is there anyone have solution?

Avatar
Abbandona
Risposta migliore

Try following:

  • 1./ <field name="chassis_number" attrs="{'invisible': [('division','not in',['Unit'])]}"/> 

OR

  • 2./ <field name="chassis_number" attrs="{'invisible': [('division','in',['Sparepart','Umum'])]}"/>

Hope this helps !!.

Avatar
Abbandona
Autore

Hi Emipro.. I have tried it, but same as before. Are you have other solution?

Check whether you didn't put same field twice on the view. i.e "Division"

Autore

I have check and there is only one field on the view

Post correlati Risposte Visualizzazioni Attività
0
ago 25
7
0
feb 25
694
2
ott 24
3581
2
giu 24
2010
1
gen 17
3707