openerp-india team mailing list archive
-
openerp-india team
-
Mailing list archive
-
Message #09004
[Bug 955051] [NEW] Product search doesn't work correctly
Public bug reported:
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.
** Affects: openobject-addons
Importance: Undecided
Status: New
--
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):
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
Follow ups
-
[Bug 955051] Re: Product search doesn't work correctly
From: Lara (Therp), 2013-01-23
-
[Bug 955051] Re: Product search doesn't work correctly
From: Lara Freeke (Therp), 2013-01-23
-
[Bug 955051] Re: Product search doesn't work correctly
From: Stefan Rijnhart (Therp), 2012-09-07
-
[Bug 955051] Re: Product search doesn't work correctly
From: Somesh Khare(OpenERP), 2012-03-30
-
[Bug 955051] Re: Product search doesn't work correctly
From: Somesh Khare(OpenERP), 2012-03-30
-
[Bug 955051] Re: Product search doesn't work correctly
From: Somesh Khare(OpenERP), 2012-03-29
-
[Bug 955051] Re: Product search doesn't work correctly
From: Somesh Khare(OpenERP), 2012-03-29
-
[Bug 955051] Re: Product search doesn't work correctly
From: Somesh Khare(OpenERP), 2012-03-29
-
[Bug 955051] Re: Product search doesn't work correctly
From: Vinay Rana (openerp), 2012-03-15
-
[Bug 955051] Re: Product search doesn't work correctly
From: Alexis Deméaulte, 2012-03-14
-
[Bug 955051] [NEW] Product search doesn't work correctly
From: Alexis Deméaulte, 2012-03-14
References