title: Odoo from old apie to new api and error TypeError: unhashable type: 'list'
body: <p>I was trying to use functions from old api to new api:</p>
  
  <pre><code>@api.multi
  def search(self, *args, **kwargs):
      offset = kwargs.get("offset", 0)
      limit = kwargs.get("limit", None)
      order = kwargs.get("order", 'complete_name')
      context = kwargs.get("context", None)
      count = kwargs.get("count", False)
      for index, expr in enumerate(args):
          if expr[1] in ['like', 'ilike', 'not ilike', 'not like', '=like']:
              args[index][2] = re.sub(r"\s+", '%', expr[2])
      return super(stock_location, self).search(*args, **kwargs)
  </code></pre>
  
  <p>and</p>
  
  <pre><code>def name_search(self, cr, uid, name='', args=None, operator='ilike', context=None, limit=80):
      args.append(['complete_name', operator, name])
      ids = self.search(cr, uid, args, limit=limit, context=context)
      return self.name_get(cr, uid, ids)
  </code></pre>
  
  <p>I got error.</p>
  
  <pre><code>Odoo Server Error
  
  Traceback (most recent call last):
    File "/opt/odoo/openerp/http.py", line 643, in _handle_exception
      return super(JsonRequest, self)._handle_exception(exception)
    File "/opt/odoo/openerp/http.py", line 680, in dispatch
      result = self._call_function(**self.params)
    File "/opt/odoo/openerp/http.py", line 316, in _call_function
      return checked_call(self.db, *args, **kwargs)
    File "/opt/odoo/openerp/service/model.py", line 118, in wrapper
      return f(dbname, *args, **kwargs)
    File "/opt/odoo/openerp/http.py", line 309, in checked_call
      result = self.endpoint(*a, **kw)
    File "/opt/odoo/openerp/http.py", line 959, in __call__
      return self.method(*args, **kw)
    File "/opt/odoo/openerp/http.py", line 509, in response_wrap
      response = f(*args, **kw)
    File "/opt/odoo/addons/web/controllers/main.py", line 892, in call_kw
      return self._call_kw(model, method, args, kwargs)
    File "/opt/odoo/addons/web/controllers/main.py", line 884, in _call_kw
      return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
    File "/opt/odoo/openerp/api.py", line 250, in wrapper
      return old_api(self, *args, **kwargs)
    File "/opt/odoo/openerp/api.py", line 381, in old_api
      result = method(recs, *args, **kwargs)
    File "/opt/odoo/openerp/models.py", line 6053, in onchange
      record._onchange_eval(name, field_onchange[name], result)
    File "/opt/odoo/openerp/models.py", line 5910, in _onchange_eval
      method_res = method(self)
    File "/home/del/addons/mik_stock/wizard/stock_operation.py", line 193, in onchange_picking_type
      if self.env['stock.location'].search_count(domain_from) == 1:
    File "/opt/odoo/openerp/api.py", line 248, in wrapper
      return new_api(self, *args, **kwargs)
    File "/opt/odoo/openerp/api.py", line 490, in new_api
      result = method(self._model, cr, uid, *args, **old_kwargs)
    File "/opt/odoo/openerp/models.py", line 1634, in search_count
      res = self.search(cr, user, args, context=context, count=True)
    File "/opt/odoo/openerp/api.py", line 250, in wrapper
      return old_api(self, *args, **kwargs)
    File "/opt/odoo/openerp/api.py", line 380, in old_api
      recs = self.browse(cr, uid, ids, context)
    File "/opt/odoo/openerp/api.py", line 250, in wrapper
      return old_api(self, *args, **kwargs)
    File "/opt/odoo/openerp/models.py", line 5361, in browse
      return self._browse(Environment(cr, uid, context or {}), ids)
    File "/opt/odoo/openerp/models.py", line 5354, in _browse
      env.prefetch[cls._name].update(ids)
  TypeError: unhashable type: 'list'
  </code></pre>
  
  <p>When I use only <code>search</code> function with decorator <code>@api.multi</code> everything seems ok. So maybe this error because of <code>name_search</code> function? Do I have decorate this function and <code>cr, uid, ids</code> change to <code>self.env</code>?</p>