From a037442c7b16f5ef919c3ff7f22897fc9182697c Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Fri, 21 Feb 2014 18:25:55 +0100 Subject: [PATCH] [FIX] stock: accept to search on internal code of product when scanned also (for those who don't use ean) + fixed error in yaml test bzr revid: qdp-launchpad@openerp.com-20140221172555-fk4roxbdto05fjpy --- addons/stock/stock.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 248704f..12f3217 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1179,7 +1179,7 @@ class stock_picking(osv.osv): product_obj = self.pool.get('product.product') stock_operation_obj = self.pool.get('stock.pack.operation') #check if the barcode correspond to a product - matching_product_ids = product_obj.search(cr, uid, [('ean13', '=', barcode_str)], context=context) + matching_product_ids = product_obj.search(cr, uid, ['|', ('ean13', '=', barcode_str), ('default_code', '=', barcode_str)], context=context) if matching_product_ids: self.process_product_id_from_ui(cr, uid, picking_id, matching_product_ids[0], context=context) @@ -1869,14 +1869,14 @@ class stock_move(osv.osv): for move in self.browse(cr, uid, ids, context=context): if move.state not in ('confirmed', 'waiting', 'assigned'): continue - if move.product_id.type == 'consu': - to_assign_moves.append(move.id) - continue if move.picking_type_id and move.picking_type_id.auto_force_assign: to_assign_moves.append(move.id) #in case the move is returned, we want to try to find quants before forcing the assignment if not move.origin_returned_move_id: continue + if move.product_id.type == 'consu': + to_assign_moves.append(move.id) + continue else: todo_moves.append(move) #build the prefered domain based on quants that moved in previous linked done move -- 1.7.10.4