From c001b6babf603e74c1a25dd9a29fb35296e65fe2 Mon Sep 17 00:00:00 2001 From: Jos De Graeve Date: Wed, 11 May 2016 16:55:00 +0200 Subject: [PATCH] FIX stock_inventory_preparation_filter search EAN13 for scanned products When using the feature 'allows to make an inventory based on scanned products', users might expect they can use the EAN13 barcode for scanning their products. --- .../models/stock_inventory.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stock_inventory_preparation_filter/models/stock_inventory.py b/stock_inventory_preparation_filter/models/stock_inventory.py index 00e0d147b..8fa5669fd 100644 --- a/stock_inventory_preparation_filter/models/stock_inventory.py +++ b/stock_inventory_preparation_filter/models/stock_inventory.py @@ -109,8 +109,10 @@ class StockInventory(models.Model): tmp_lines[line.product_code] = line.product_qty inventory.empty_line_ids.unlink() for product_code in tmp_lines.keys(): - products = product_obj.search( - [('default_code', '=', product_code)]) + products = product_obj.search([ + '|', ('default_code', '=', product_code), + ('ean13', '=', product_code), + ]) if products: product = products[0] fake_inventory = StockInventoryFake(