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’])
for node in doc.xpath(“//field[@name=’field_a’]”):
result[‘arch’] = etree.tostring(doc)
Hope this help.
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
|Asked: 7/13/16, 1:01 AM|
|Seen: 211 times|
|Last updated: 7/13/16, 5:24 AM|