From 73072272de8ab32b0fe199d54a90986dc02d1dbc Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 3 Sep 2014 18:25:19 +0200 Subject: [PATCH] [FIX] mrp: do not reset back stock moves to confirm For instance, setting a BOM Phantom with: Finished product: stockable, MTO Manufacture Components: stockable, MTS, Buy. Inventory set to 1000 Stock moves of components are directly set to assigned once the procurement confirmed thanks to JIT The stock moves should not be set back to confirmed after they have been assigned --- addons/mrp/stock.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/mrp/stock.py b/addons/mrp/stock.py index 60a50c90d1e..51c237672a0 100644 --- a/addons/mrp/stock.py +++ b/addons/mrp/stock.py @@ -160,9 +160,11 @@ class StockPicking(osv.osv): def action_explode(self, cr, uid, move_ids, *args): """Explodes moves by expanding kit components""" move_obj = self.pool.get('stock.move') - todo = move_ids[:] + todo = list(super(StockPicking, self).action_explode(cr, uid, move_ids, *args)) for move in move_obj.browse(cr, uid, move_ids): - todo.extend(move_obj._action_explode(cr, uid, move)) + result = move_obj._action_explode(cr, uid, move) + moves = move_obj.browse(cr, uid, result) + todo.extend(move.id for move in moves if move.state not in ['confirmed', 'assigned', 'done']) return list(set(todo)) StockPicking()