Odoo Help


Create dynamic tree view

on 7/13/16, 1:01 AM 361 views

How to create dynamic tree view? or hidden field in tree view?

Nikunj Antala
On 7/13/16, 2:46 AM

Hello Irawan,

You can create dynamic tree view using fields_view_get method.


    from lxml import etree


        def fields_view_get(self, view_id=None, view_type=’tree’, context=None, toolbar=False,submenu=False): 

        result = super(model_name,self).fields_view_get(view_id=view_id, view_type=view_type, toolbar=toolbar, submenu=submenu)

        doc = etree.XML(result[‘arch’])

        if new_string:

        for node in doc.xpath(“//field[@name=’field_a’]”):

            node.set(‘string’, new_string)

        result[‘arch’] = etree.tostring(doc)

        return result

Hope this help.

Thank you.

But, how to trigger that when onchange?

on 7/13/16, 5:25 AM
On 7/13/16, 5:23 AM

Thank you.

But, how to trigger that when onchange?

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: 7/13/16, 1:01 AM
Seen: 361 times
Last updated: 7/13/16, 5:24 AM