From 10b730af8ac7d1a247f41bc2f7d6a8fd1a1ee498 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 21 Nov 2016 12:53:32 +0100 Subject: [PATCH] [FIX] stock: fix stock picking done quantity computation This is an oversight during the port of 3de53fa165baf76cde7f2593d4fb26f2cc7a5383 in the forward port revision 3a2147d95c8005ab7c1dbe4d94315e404ea5e5f9 In the revision 3de53fa165baf76cde7f2593d4fb26f2cc7a5383, 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 --- addons/stock/models/stock_picking.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/models/stock_picking.py b/addons/stock/models/stock_picking.py index b1abc518806..20b261aa7f2 100644 --- a/addons/stock/models/stock_picking.py +++ b/addons/stock/models/stock_picking.py @@ -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