From a1135313a6a2c97cb64bfa6111b6453bae65f385 Mon Sep 17 00:00:00 2001 From: skh Date: Fri, 20 May 2011 13:05:20 +0530 Subject: [PATCH] [FIX] Product: name_search() corrected while duplicating ids in sale_order_line (Ref : Case 5861) bzr revid: skh@tinyerp.com-20110520073520-5abu4xp34x74dhxu --- addons/product/product.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/product/product.py b/addons/product/product.py index f82e5791fd7..b566ac681e9 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -563,8 +563,7 @@ class product_product(osv.osv): if not len(ids): ids = self.search(cr, user, [('ean13','=',name)]+ args, limit=limit, context=context) if not len(ids): - ids = self.search(cr, user, [('default_code',operator,name)]+ args, limit=limit, context=context) - ids += self.search(cr, user, [('name',operator,name)]+ args, limit=limit, context=context) + ids = self.search(cr, user, ['|',('name',operator,name),('default_code',operator,name)] + args, limit=limit, context=context) if not len(ids): ptrn=re.compile('(\[(.*?)\])') res = ptrn.search(name)