Many2one value display in OpenERP -


i tried create simple many2one field values showing in format: new.base,1 , new.base,2 , on. please let me know fix display value same.

class latest_base(osv.osv):        _inherit = ['mail.thread']        _name='latest.base'        _columns={                 'name':fields.char('name',required=true),                  'image': fields.binary("image", help="select image here"),                   'email':fields.char('email'),                 'code':fields.many2one('new.base','code'),                }    latest_base()     class new_base(osv.osv):         _name='new.base'        _columns={                'code':fields.char('department'),                 'hod':fields.char("head of department"),                }  new_base() 

try this, name special fields in openerp , unique name used default labels in forms, lists, etc. if don't use name in table use _rec_name specify field use.

class latest_base(osv.osv):    _inherit = ['mail.thread']    _name='latest.base'    _columns={             'name':fields.char('name',required=true),             'image': fields.binary("image", help="select image here"),             'email':fields.char('email'),             'code':fields.many2one('new.base','code'),            }  latest_base()  class new_base(osv.osv):    _name='new.base'    _rec_name = 'code'    _columns={            'code':fields.char('department'),            'hod':fields.char("head of department"),            } new_base() 

hope solve problem.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -