Product search doesn't work correctly
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/
if len(ids) < limit:
ids.
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/
res_ids = [x[0] for x in field_obj.
So the search on the "name" field in the name_search method of product_product is never done.
Related branches
- Naresh(OpenERP) (community): Approve
- Olivier Dony (Odoo): Approve
- Somesh Khare (community): Needs Resubmitting
-
Diff: 15 lines (+2/-2)1 file modifiedproduct/product.py (+2/-2)
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 |
Changed in openobject-addons: | |
importance: | Undecided → Low |
Changed in openobject-addons: | |
status: | Fix Committed → Confirmed |
status: | Confirmed → In Progress |
Changed in therp-backports: | |
milestone: | none → 6.1-maintenance |
status: | New → Fix Released |
Changed in therp-backports: | |
milestone: | 6.1-maintenance → 7.0-maintenance |
I forgot to tell that I got this problem on the 6.1 branch of the addons.