Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
5899 Переглядів

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?

Аватар
Відмінити
Найкраща відповідь

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 !!.

Аватар
Відмінити
Автор

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"

Автор

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

Related Posts Відповіді Переглядів Дія
0
серп. 25
52
0
лют. 25
748
2
жовт. 24
3631
Removeing attrs in 17.0 Вирішено
2
черв. 24
2165
1
січ. 17
3768