Odoo Help

Welcome!

This community 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.

0

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

By
Ayyappan
on 9/30/16, 1:27 AM 335 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.

0
shameem@aχoncoms
On 9/30/16, 11:56 PM

Try 

<div attrs="{'invisible':[('price_chk', '=', False)]}">
     <field name="Price1"/>
</div>
0
Juan
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

Ayyappan
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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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