From faa3ff46e25573fd5ff4a46df965b8454125e723 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Tue, 3 Jan 2017 08:03:06 +0100 Subject: [PATCH] HACK: extend product.product name_search() for x_sysmo_barcode This should be properly done in an extension, but was easier to add to the core product.product code right now :/ --- addons/product/product.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/product/product.py b/addons/product/product.py index 69a526d62c3..bca70f02460 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -1132,6 +1132,8 @@ class product_product(osv.osv): ids = self.search(cr, user, [('default_code','=',name)]+ args, limit=limit, context=context) if not ids: ids = self.search(cr, user, [('ean13','=',name)]+ args, limit=limit, context=context) + if not ids: + ids = self.search(cr, user, [('x_sysmo_barcode','=',name)]+ args, limit=limit, context=context) if not ids and operator not in expression.NEGATIVE_TERM_OPERATORS: # Do not merge the 2 next lines into one single search, SQL search performance would be abysmal # on a database with thousands of matching products, due to the huge merge+unique needed for the