使用field_view_get过程中遇到的问题,望大佬解疑!!!
-
def fields_view_get(self, cr, uid, view_id='work_coordination_order_tree_view', view_type='tree', context=None, toolbar=False, submenu=False): if context is None: context = {} res = super(work_coordination_order,self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu) if view_type == 'tree': for node in doc.xpath("//field[@name='project']"): node.addnext(etree.Element('field', {'name': 'state', 'string': 'state', 'nolabel': '1'})) node.addnext(etree.Element('field', {'name': 'contact_telephone', 'string': 'contact_telephone','nolabel': '1'})) node.addnext(etree.Element('field', {'name': 'project_contact', 'string': 'project_contact', 'nolabel': '1'})) res['arch'] = etree.tostring(doc) return res
为什么我使用后,我添加的字段的值像many2one,many2many,one2many一类的关系性值,只显示对应的id,而不显示,对应的id的值呢。
还有就是,添加的这些字段,原来都是有翻译的,新添加进去就没有了,只显示我添加的string所对应的值。