from netforce.model import Model, fields class Partner(Model): _inherit="partner" _fields={ 'walkin_cust': fields.Boolean("Walkin Customer"), 'is_patient': fields.Boolean("Is Patient"), 'is_staff': fields.Boolean("Is Staff"), } def name_get(self,ids,context={}): vals=[] for obj in self.browse(ids): name=obj.name or "" if obj.code: name=" %s (%s)"%(name,obj.code) vals.append((obj.id,name)) return vals def name_search(self,name,domain=None,condition=[],context={},**kw): dom=[["name","ilike","%"+name+"%"]] if domain: dom=[dom,domain] ids1=self.search(dom) dom=[["code","ilike","%"+name+"%"]] if domain: dom=[dom,domain] ids2=self.search(dom) ids=list(set(ids1+ids2)) return self.name_get(ids,context=context) Partner.register()