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

how to hide column in tree view on state changes??i have tried attrs but not working..???

الصورة الرمزية
إهمال
أفضل إجابة

Hi

confirm your attrs like this :

<field name="field_name" attrs="{'invisible':[('state','=','done')]}"/>

it will work fine :)

Thanks

الصورة الرمزية
إهمال
الكاتب

i have tried this in form as well as in tree view,it is not working in tree view but working fine in form view..!! Any idea???

ATTRs does'nt work in tree view

أفضل إجابة

Hi,

see answer Francesco Apruzzese you can't hide/show field in tree.

you can use invisible but 0 or 1 :

<field name="field_name"  invisible="0" />    -- show
<field name="field_name"  invisible="1" />    -- hide

but if you can customize your tree you can use colors .color red if state=='failure', blue if state=='draft'...

<tree string="tree_string" colors="red:state=='failure';blue:state=='draft'">
الصورة الرمزية
إهمال
أفضل إجابة

When you have a tree view you can't hide/show field. This is normal because in a tree can be a lot of record with different datas inside. If you want hide a field in a tree in relation to status, you can have some field with state A and other with state B. What can OpenERP do in this case?

So, you request is invalid because attrs work fine in form but is not usable in tree to show/hide field.

الصورة الرمزية
إهمال
الكاتب

Hello , thank you for giving quick response,,,you are saying that attrs doesn't work in tree view than how can i hide columns on state changes???? Is there any way instead of attrs..!?? Thank you.

No, I've expose you than is impossible. In tree you can't hide/show field in relation to other field value

أفضل إجابة

Hello,

I think you can put a conditional base filter to hide field in tree view..

Example :

<field name="origin" invisible="context.get('picking_type', False) in ['in']"/>

Thanks.

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
4
ديسمبر 23
21062
3
يوليو 25
9451
3
أبريل 25
5260
0
فبراير 25
878
2
أكتوبر 24
3868