Merge lp:~openerp-dev/openobject-addons/6.1-opw-591387-pna into lp:openobject-addons/6.1

Proposed by Pinakin Nayi (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-591387-pna
Merge into: lp:openobject-addons/6.1
Diff against target: 12 lines (+1/-1)
1 file modified
product/ (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-591387-pna
Reviewer Review Type Date Requested Status
Anaël Closson (openerp) (community) Disapprove
Naresh(OpenERP) Pending
Review via email:

Description of the change

Hello Sir,

I fixed issue in product .

To Reproduce :
Suppose , there are 7 products :
product name like : product 1,product 2,product 3, product 4, product 5, product 6, product 7 2202,

now for product 1 to 6 have reference like 22020000.

Now, if we try to search like '2202' in sale order line it will search(product) for only 1 to 6 product.


To post a comment you must log in.
Revision history for this message
Anaël Closson (openerp) (acl-openerp) wrote :

This is a wanted behavior : if you type a product reference (that should be unique if you want it to be efficient) you only suppose to get the related product, and not other ones.

It's not quite frequent to find complete and incomplete references in products name (though a bad practice IMO).

With this approach, if you type the '2202' because you want to get the related product and switch to the next field, you might select products with '2202' in the name. More you have such products, harder it will be to find the product you're trying to select.

Unlike your scenario, all references starting with '2202' will show up if you type '2202', just like products having '2202' in their names, __If you don't have products whose reference is '2202'__. If OpenERP found a matching reference, it will only show that one in the list.

review: Disapprove

Unmerged revisions

7211. By Pinakin Nayi (OpenERP)

[FIX]product: problem in product search it will not proper search with product name

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'product/'
2--- product/ 2012-04-03 13:05:28 +0000
3+++ product/ 2013-05-15 09:43:36 +0000
4@@ -610,7 +610,7 @@
5 # OR operator (and given the fact that the 'name' lookup results come from the ir.translation table
6 # Performing a quick memory merge of ids in Python will give much better performance
7 ids = set()
8- ids.update(, user, args + [('default_code',operator,name)], limit=limit, context=context))
9+ ids.update(, user, args + ['|',('default_code',operator,name),('name',operator,name)], limit=limit, context=context))
10 if len(ids) < limit:
11 # we may underrun the limit because of dupes in the results, that's fine
12 ids.update(, user, args + [('name',operator,name)], limit=(limit-len(ids)), context=context))