From c8f16d93acee7f7eb88a6746b8db99e63f027599 Mon Sep 17 00:00:00 2001 From: Michael Tietz Date: Wed, 15 May 2024 10:29:04 +0200 Subject: [PATCH] [IMP] stock_mts_mto_rule: Fix location Use src location of intial rule to check the available quantity --- stock_mts_mto_rule/models/stock_rule.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stock_mts_mto_rule/models/stock_rule.py b/stock_mts_mto_rule/models/stock_rule.py index b67b8742a..76ee3ea12 100644 --- a/stock_mts_mto_rule/models/stock_rule.py +++ b/stock_mts_mto_rule/models/stock_rule.py @@ -45,7 +45,7 @@ class StockRule(models.Model): precision = self.env["decimal.precision"].precision_get( "Product Unit of Measure" ) - src_location_id = self.mts_rule_id.location_src_id.id + src_location_id = self.location_src_id.id product_location = product.with_context(location=src_location_id) virtual_available = self._get_available_quantity_mts_mto_rule(product_location) qty_available = product.uom_id._compute_quantity(virtual_available, product_uom)