[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:
parent
c0d838ddb3
commit
73072272de
|
@ -160,9 +160,11 @@ class StockPicking(osv.osv):
|
||||||
def action_explode(self, cr, uid, move_ids, *args):
|
def action_explode(self, cr, uid, move_ids, *args):
|
||||||
"""Explodes moves by expanding kit components"""
|
"""Explodes moves by expanding kit components"""
|
||||||
move_obj = self.pool.get('stock.move')
|
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):
|
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))
|
return list(set(todo))
|
||||||
|
|
||||||
StockPicking()
|
StockPicking()
|
||||||
|
|
Loading…
Reference in New Issue