Odoo Help


How to add fields in Listview from fields_view_get?

Viraj Joshi
on 1/13/15, 9:05 AM 1,158 views


I want to add fields in listview from fields_view_get method, as well as wants to fill up data for these fields.

I have data and fields in dictionary.

I got some help to update attributes of fields, but I want more than this.

from lxml import etree

arch = etree.XML(res['arch'])

for node in arch.xpath("//field[@name='code']"):

        node.set('readonly', '1')

res['arch'] = etree.tostring(arch)

But I want to add new fields (dynamically n numbers of field) using code.

Can any one help me ?

Thanks in advance.


Techno-Functional Associate with 7+ years of experience in Odoo (formerly known as OpenERP).

On 1/14/15, 10:26 AM

You can do it in 2 ways:

One best way to do is... add all fields in the Tree View, with invisible property, then in fields_view_get change the invisible property based on your requirement..

Other One: In fields_view_get redefining your entrie Tree View dynamically... OR have different views, and call the respective view in this method



Hi deep, thw for your answer but my problem is that the part of the view is dynamic. I have a field name "type" and on_change of type value some fields is invisible or no!! how to manage it please! I've already used the function on_change and redefine res['arch'] in this function but it is not work!

on 2/27/15, 9:36 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

1 follower(s)


Asked: 1/13/15, 9:05 AM
Seen: 1158 times
Last updated: 5/21/16, 3:32 AM