[FIX] stock: fix stock picking done quantity computation

This is an oversight during the port of
3de53fa165
in the forward port revision
3a2147d95c

In the revision 3de53fa165,
the code has not only been moved,
but the variable passed to the method `rereserve_quants`
argument `move_ids` changed as well.
This has been missed during the port of the revision.

This leads to the invalid computation of the `done` quantity
in the pickings in some cases were the quants need to be
re-reserved.

opw-690244
This commit is contained in:
Denis Ledoux
2016-11-21 13:23:22 +01:00
parent ab279d9cea
commit 10b730af8a
+1 -1
View File
@@ -862,7 +862,7 @@ class Picking(models.Model):
moves_reassign = any(x.origin_returned_move_id or x.move_orig_ids for x in picking.move_lines if x.state not in ['done', 'cancel'])
if moves_reassign and picking.location_id.usage not in ("supplier", "production", "inventory"):
# unnecessary to assign other quants than those involved with pack operations as they will be unreserved anyways.
picking.with_context(reserve_only_ops=True, no_state_change=True).rereserve_quants(move_ids=todo_moves.ids)
picking.with_context(reserve_only_ops=True, no_state_change=True).rereserve_quants(move_ids=picking.move_lines.ids)
picking.do_recompute_remaining_quantities()
# split move lines if needed