I need to add a field with the help of fields_view_get ORM method.
For example: I have to add field Test after field Summary. How should I add the field directly at py.
eview = etree.fromstring(res['arch'])
summary = eview.xpath("field[@name='summary']")
if len(summary):
summary = summary[0]
summary.addnext(etree.Element('field', {'name': 'test', 'nolabel': '1'}))res['arch'] = etree.tostring(eview)
If I don't have a field named "test" defined in XML, this code shows the following client error
OpenERP Client error
Error: Field 'test' specified in view could not be found.
http://localhost:8069/web/static/src/js/view_form.js:1236
Note:
I know how to add the field directly in XML, so provide me help with regards to fields_view_get only.