[FIX] stock: auto_validate move not set to done when multiple parent move set to done at the same time (opw 607970)

This commit is contained in:
Martin Trigaux 2014-05-27 17:47:28 +02:00
commit 1ef2c18103
1 changed files with 1 additions and 1 deletions

View File

@ -2413,7 +2413,7 @@ class stock_move(osv.osv):
# Downstream move should only be triggered if this move is the last pending upstream move
other_upstream_move_ids = self.search(cr, uid, [('id','!=',move.id),('state','not in',['done','cancel']),
('move_dest_id','=',move.move_dest_id.id)], context=context)
if not other_upstream_move_ids:
if not set(other_upstream_move_ids) - set(move_ids):
self.write(cr, uid, [move.id], {'move_history_ids': [(4, move.move_dest_id.id)]})
if move.move_dest_id.state in ('waiting', 'confirmed'):
self.force_assign(cr, uid, [move.move_dest_id.id], context=context)