Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
5782 Weergaven

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
Annuleer
Beste antwoord

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
Annuleer
Auteur

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"

Auteur

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

Gerelateerde posts Antwoorden Weergaven Activiteit
0
aug. 25
7
0
feb. 25
669
2
okt. 24
3554
2
jun. 24
1971
1
jan. 17
3678