From 659341b06f3476c89da6bf26ec67b0ddc1a0c898 Mon Sep 17 00:00:00 2001 From: geomer198 Date: Thu, 28 Sep 2023 23:39:24 +0400 Subject: [PATCH] [FIX] stock_reserve_rule: _apply_strategy_single_lot stratagy is updated. --- stock_reserve_rule/models/stock_reserve_rule.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stock_reserve_rule/models/stock_reserve_rule.py b/stock_reserve_rule/models/stock_reserve_rule.py index d591f38fbcc..d9f9dcb6abe 100644 --- a/stock_reserve_rule/models/stock_reserve_rule.py +++ b/stock_reserve_rule/models/stock_reserve_rule.py @@ -327,6 +327,7 @@ def _apply_strategy_single_lot(self, quants): ("lot_id", "!=", False), ("location_id", "in", location.ids), ("product_id", "=", product.id), + ("quantity", ">", 0), ], ["lot_id", "quantity"], ["lot_id"], @@ -342,6 +343,7 @@ def _apply_strategy_single_lot(self, quants): for rec_id, product_qty in lot_ids_with_quantity.items(): if comparison(product_qty, need): lot_id = rec_id + break if location_quantity > 0 and lot_id: lot_id = self.env["stock.production.lot"].browse(lot_id) need = yield location, location_quantity, need, lot_id, None