Odoo Help


How to hide one2many's field column in tree view based on parent field value

on 9/30/16, 1:27 AM 426 views

I have created a new field in sale order line named as "Price1" and "Price_chk" boolean field in Sale order. The field "Price1" should be invisible in tree view when the field "Price_chk" is False and it should be visible when the field "Price_chk" is True.



<div attrs="{'invisible':[('price_chk', '=', False)]}">
     <field name="Price1"/>
On 9/30/16, 4:08 AM

You can do it with attrs and invisible in the xml.

<field name="Price1" attrs="{'invisible':[('price_chk', '=', False)]}" />

I tried this, but it was not working. Because "attrs" is not working in one2many treeview

on 9/30/16, 5:45 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

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

1 follower(s)


Asked: 9/30/16, 1:27 AM
Seen: 426 times
Last updated: 9/30/16, 11:56 PM