[FIX] product: name_search() should only look for exact product codes
authorOlivier Dony <odo@openerp.com>
Tue, 1 Feb 2011 12:34:28 +0000 (13:34 +0100)
committerOlivier Dony <odo@openerp.com>
Tue, 1 Feb 2011 12:34:28 +0000 (13:34 +0100)
bzr revid: odo@openerp.com-20110201123428-jr2gqkci3s63rih9

addons/product/product.py

index ff18fad..801e647 100644 (file)
@@ -567,7 +567,7 @@ class product_product(osv.osv):
                ptrn=re.compile('(\[(.*?)\])')
                res = ptrn.search(name)
                if res:
-                   ids = self.search(cr, user, [('default_code','ilike',res.group(2))]+ args, limit=limit, context=context)
+                   ids = self.search(cr, user, [('default_code','=', res.group(2))] + args, limit=limit, context=context)
         else:
             ids = self.search(cr, user, args, limit=limit, context=context)
         result = self.name_get(cr, user, ids, context=context)