~openerp/openobject-server/qdp-res-currency-name-search-case-insensitive

« back to all changes in this revision

Viewing changes to openerp/addons/base/res/res_currency.py

  • Committer: Quentin (OpenERP)
  • Date: 2011-10-11 09:43:08 UTC
  • Revision ID: qdp-launchpad@openerp.com-20111011094308-920qarleuod0k6n2
[IMP] base, res.currency: improved name_search to be case insensitive

Show diffs side-by-side

added added

removed removed

Lines of Context:
110
110
        if not args:
111
111
            args = []
112
112
        if name:
113
 
            ids = self.search(cr, user, ([('name','=',name)] + args), limit=limit, context=context)
 
113
            ids = self.search(cr, user, ([('name','ilike',name)] + args), limit=limit, context=context)
114
114
            name_match = CURRENCY_DISPLAY_PATTERN.match(name)
115
115
            if not ids and name_match:
116
 
               ids = self.search(cr, user, [('name','=', name_match.group(1))] + args, limit=limit, context=context)
 
116
               ids = self.search(cr, user, [('name','ilike', name_match.group(1))] + args, limit=limit, context=context)
117
117
        else:
118
118
            ids = self.search(cr, user, args, limit=limit, context=context)
119
119
        return self.name_get(cr, user, ids, context=context)