Is it possible to hide fields from tree view based on some condition?

22‏/7‏/2013 9:34 ص8,005 views

I am working on 'stock.picking' there is a one2many field 'move_ids'. I need to add two more attributes in this field.
But I need to show these two attributes in case of picking is returned. There is nothing in object to know if the picking is
of return. neither in parent nor in child object.

So I made a selection field named 'type_return' with values 'return' and 'non_return' and two more fields ' attrib1' and 'attrib2'
Now I need to show these fields in tree view* [ <tree editable="bottom"> ]* just in case of picking is returned. this I can know by value of 'type_return'.

I used: attrs="{'invisible':[('type_return', '!=', 'return')]}" .But it did not work for me.