← Back to team overview

openerp-india team mailing list archive

[Bug 955051] Re: Product search doesn't work correctly

 

** Also affects: therp-backports/addons-6.1
   Importance: Undecided
       Status: Fix Released

** Also affects: therp-backports/addons-7.0
   Importance: Undecided
       Status: New

** Changed in: therp-backports/addons-6.1
    Milestone: 7.0-maintenance => None

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/955051

Title:
  Product search doesn't work correctly

Status in OpenERP Addons (modules):
  Fix Committed
Status in Therp Backports:
  Fix Released
Status in Therp Backports addons-6.1 series:
  Fix Released
Status in Therp Backports addons-7.0 series:
  New

Bug description:
  Hi,

  It seems that there is a bug when you search a product. If you try to
  find stock moves with a filter on the product name, the filter is only
  applied on the default_code field of the product_product object, and
  not on the "name" field of product_product. However if you do the
  search directly from the product search view,  you are able to apply a
  filter on the name or on the default_code field, so it works.

  The problem comes from  the "name_search" method of the
  product_product class. There is a test line 614 in
  addons/product/product.py file :

  if len(ids) < limit:
      ids.update(self.search(cr, user, args + [('name',operator,name)], limit=(limit-len(ids)), context=context))

  but this test is always wrong when the search is ran undirectly, like
  from the stock_move search view, because the "limit" value is always
  set to None. In this case the name_search method is called by
  _get_expression in server/openerp/osv/expression.py file, line 593 :

  res_ids = [x[0] for x in field_obj.name_search(cr, uid, right, [],
  operator, limit=None, context=c)]

  So the search on the "name" field in the name_search method of
  product_product  is never done.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/955051/+subscriptions


References