تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
5814 أدوات العرض

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

المنشورات ذات الصلة الردود أدوات العرض النشاط
0
أغسطس 25
7
0
فبراير 25
693
2
أكتوبر 24
3580
2
يونيو 24
1998
1
يناير 17
3703