From fd44ff38a3eef8a0efad7488dba2d99acd9fda62 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Thu, 3 May 2018 09:30:02 +0200 Subject: [PATCH] [FIX] stock: reserved qty, typo expected singleton In 4322985a at one point several stock.move could be selected when we just wanted the first one. opw-1840719 closes #24538 --- 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 b598dde25dd..3abf0979c0a 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -877,7 +877,7 @@ class StockMove(models.Model): to_update = self.move_line_ids.filtered(lambda m: m.product_id.tracking != 'serial' and 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(quantity, to_update.product_uom_id, rounding_method='HALF-UP') + to_update[0].with_context(bypass_reservation_update=True).product_uom_qty += self.product_id.uom_id._compute_quantity(quantity, to_update[0].product_uom_id, rounding_method='HALF-UP') else: if self.product_id.tracking == 'serial': for i in range(0, int(quantity)):