From 2a0b158d4490817388da7de94969447d02744386 Mon Sep 17 00:00:00 2001 From: Simon Lejeune Date: Wed, 26 Jul 2017 16:19:26 +0200 Subject: [PATCH] [FIX] stock: move: _update_reserved_quantity When a move line is reserved on multiple quants, we increased it with the `taken_quantity` variable, which is used to know how much quantity we try to reserve in total for this move, not what is available on the quant. The amount to increase is obviously the one returned by `stock.quant` and is available in the loop. --- addons/stock/models/stock_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py index 631d7542e0c..a88cdc1ef4e 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -694,7 +694,7 @@ class StockMove(models.Model): for reserved_quant, quantity in quants: to_update = self.move_line_ids.filtered(lambda m: m.location_id.id == reserved_quant.location_id.id and m.lot_id.id == reserved_quant.lot_id.id and m.package_id.id == reserved_quant.package_id.id and m.owner_id.id == reserved_quant.owner_id.id) if to_update: - to_update[0].with_context(bypass_reservation_update=True).product_uom_qty += self.product_id.uom_id._compute_quantity(taken_quantity, self.product_uom, rounding_method='HALF-UP') + to_update[0].with_context(bypass_reservation_update=True).product_uom_qty += self.product_id.uom_id._compute_quantity(quantity, self.product_uom, rounding_method='HALF-UP') else: if self.product_id.tracking == 'serial': for i in range(0, int(quantity)):