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 :/
This commit is contained in:
Harald Welte 2017-01-03 08:03:06 +01:00
parent d07b59d4ba
commit 39180387a1
1 changed files with 2 additions and 0 deletions

View File

@ -1130,6 +1130,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