From ff0559cd8c3685a5a01d5da703ef0f74d9ad45bd Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Fri, 16 Jun 2023 16:57:35 +0200 Subject: [PATCH] [FIX] stock_inventory_discrepancy: Ensure active_ids value Steps to reproduce: - Enter a product. - Navigate to stock on hand. - Adjust quantity and rebase discrepancy limit. - Accept the discrepancy popup. You get an error as the ID to be tried to adjust is the product one, not the quant one. We need to overwrite active_ids context with the quant IDs to be handled on the wizard popup. TT43947 --- stock_inventory_discrepancy/models/stock_quant.py | 1 + 1 file changed, 1 insertion(+) diff --git a/stock_inventory_discrepancy/models/stock_quant.py b/stock_inventory_discrepancy/models/stock_quant.py index 8659eb206..7ec8ef851 100644 --- a/stock_inventory_discrepancy/models/stock_quant.py +++ b/stock_inventory_discrepancy/models/stock_quant.py @@ -63,6 +63,7 @@ class StockQuant(models.Model): action["context"] = dict( self._context.copy(), discrepancy_quant_ids=over_discrepancy.ids, + active_ids=self.ids, ) return action return super().action_apply_inventory()