From 526353db3c0e053b722d7c92a058d152619ed030 Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Thu, 20 Feb 2014 15:05:06 +0100 Subject: [PATCH] [IMP] Take into account returned move in auto force assign the correct way bzr revid: jco@openerp.com-20140220140506-velvy6yxliyujmtk --- addons/stock/stock.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 10addb4889f..2beca819d27 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1848,10 +1848,13 @@ 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' or (move.picking_type_id and move.picking_type_id.auto_force_assign): + if move.picking_type_id and move.picking_type_id.auto_force_assign: to_assign_moves.append(move.id) - if move.product_id.type == 'consu' or (not move.origin_returned_move_id): + 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