Product search doesn't work correctly

Bug #955051 reported by Alexis Deméaulte
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Committed
Low
OpenERP Publisher's Warranty Team
Therp Backports (Deprecated)
Status tracked in Addons-6.1
Addons-6.1
Fix Released
Undecided
Unassigned
Addons-7.0
New
Undecided
Unassigned

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.

Tags: maintenance

Related branches

Revision history for this message
Alexis Deméaulte (alexis-demeaulte) wrote :

I forgot to tell that I got this problem on the 6.1 branch of the addons.

Changed in openobject-addons:
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
tags: added: maintenance
Changed in openobject-addons:
status: New → Confirmed
status: Confirmed → In Progress
Revision history for this message
Somesh Khare (somesh.khare) wrote :

Hello Alexis Deméaulte,

It has been fixed into the lp:~openerp-dev/openobject-addons/6.1-opw-572802-skh branch with,

Revision ID: <email address hidden>
Revision Number: 6709

This branch is under the review of our experts and will be merged soon into the stable 6.1 branch

Thanks

Changed in openobject-addons:
status: In Progress → Fix Committed
Changed in openobject-addons:
importance: Undecided → Low
Changed in openobject-addons:
status: Fix Committed → Confirmed
status: Confirmed → In Progress
Revision history for this message
Somesh Khare (somesh.khare) wrote :

Hello Alexis Deméaulte,

It has been fixed into the lp:~openerp-dev/openobject-addons/6.1-opw-572802-skh branch with,

Revision ID: <email address hidden>
Revision Number: 6718

This branch is under the review of our experts and will be merged soon into the stable 6.1 branch

Thanks

Changed in openobject-addons:
status: In Progress → Fix Committed
Changed in therp-backports:
milestone: none → 6.1-maintenance
status: New → Fix Released
Lara (Therp) (lfreeke)
Changed in therp-backports:
milestone: 6.1-maintenance → 7.0-maintenance
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.