~openerp-dev/openobject-server/trunk-improve-configuration-warnings-tpa

« back to all changes in this revision

Viewing changes to openerp/addons/base/ir/ir_ui_view.py

  • Committer: Sunil Sharma
  • Date: 2014-05-09 11:18:54 UTC
  • mfrom: (5214.1.2 trunk)
  • Revision ID: ssh@tinyerp.com-20140509111854-rz9rujk3g0oqien6
[mrg]:lp:openobject-server

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
        'arch': fields.text('View Architecture', required=True),
69
69
    }
70
70
 
 
71
    def name_get(self, cr, uid, ids, context=None):
 
72
        return [(rec.id, rec.user_id.name) for rec in self.browse(cr, uid, ids, context=context)]
 
73
 
 
74
    def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100):
 
75
        if args is None:
 
76
            args = []
 
77
        if name:
 
78
            ids = self.search(cr, user, [('user_id', operator, name)] + args, limit=limit)
 
79
            return self.name_get(cr, user, ids, context=context)
 
80
        return super(view_custom, self).name_search(cr, user, name, args=args, operator=operator, context=context, limit=limit)
 
81
 
 
82
 
71
83
    def _auto_init(self, cr, context=None):
72
84
        super(view_custom, self)._auto_init(cr, context)
73
85
        cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = \'ir_ui_view_custom_user_id_ref_id\'')