Odoo Help


attrs not working????

Nirav Bhadradiya
on 5/13/13, 5:06 AM 4,133 views

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


ClueLogics Technologies Pvt. Ltd.

--ClueLogics Technologies Pvt. Ltd.--
| 6 5 8
Delhi NCR, India
--ClueLogics Technologies Pvt. Ltd.--

 ClueLogics Technologies Pvt Ltd is a Software product and services provider. We are positioned to deliver robust, rapid and reliable Information Technology solutions that work. What we succeed upon is Technology and Technical Expertise. The industry review of ClueLogics has been commendable for the past years as most of its business comes from repeat orders by highly satisfied clients.

ClueLogics Technologies Pvt. Ltd.
On 5/13/13, 6:03 AM


confirm your attrs like this :

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

it will work fine :)


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???

Nirav Bhadradiya
on 5/13/13, 6:39 AM

ATTRs does'nt work in tree view

ClueLogics Technologies Pvt. Ltd.
on 5/13/13, 7:05 AM


--Borni DHIFI--
| 6 8 9
Tunis, Tunisia
--Borni DHIFI--

Techno Functional Consultant Odoo(OpenERP) 


Skype : dhifi.borni

On 5/13/13, 5:42 AM


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'">

Pinakin Nayi (pna)

--Pinakin Nayi (pna)--
| 2 1 5
Ahmedabad, India
--Pinakin Nayi (pna)--

He has good skills in problem identification and implementation of effective solutions. He is working in RD India validation team.

Skype: pinakinerp

LinkedIn : https://www.linkedin.com/in/pinakin-nayi-2a33103a/


Pinakin Nayi (pna)
On 12/19/13, 2:23 AM


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']"/>



Francesco OpenCode

--Francesco OpenCode--

| 6 8 9
Grottaglie, Italy
--Francesco OpenCode--

Italian Odoo (OpenERP) Modules Developer LINKEDIN: http://www.linkedin.com/in/francescoapruzzese

Francesco OpenCode
On 5/13/13, 7:46 AM

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.

Nirav Bhadradiya
on 5/13/13, 8:31 AM

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

Francesco OpenCode
on 5/13/13, 11:35 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 5/13/13, 5:06 AM
Seen: 4133 times
Last updated: 3/16/15, 8:10 AM