[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
This commit is contained in:
Denis Ledoux 2014-09-03 18:25:19 +02:00
parent c0d838ddb3
commit 73072272de
1 changed files with 4 additions and 2 deletions

View File

@ -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()