Skip to content
  • Categories
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse

Odoo 中文社区

  1. Home
  2. Categories
  3. Odoo 开发与实施交流
  4. 使用field_view_get过程中遇到的问题,望大佬解疑!!!

使用field_view_get过程中遇到的问题,望大佬解疑!!!

Scheduled Pinned Locked Moved Odoo 开发与实施交流
1 Posts 1 Posters 379 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    handen
    wrote on last edited by handen
    #1
    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所对应的值。

    1 Reply Last reply
    0

    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Tags
    • Popular
    • Users
    • Groups