From 25dac1f18e5ae3436484830c56ea479c7208abc1 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Mon, 29 Jul 2024 09:49:53 +0530 Subject: [PATCH] fix: builtins.KeyError: ('ABC', 'Store - CP') (#42505) --- erpnext/stock/stock_ledger.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index 38b1e7752a8a..91db662473bc 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -275,7 +275,9 @@ def repost_future_sle( ) affected_transactions.update(obj.affected_transactions) - distinct_item_warehouses[(args[i].get("item_code"), args[i].get("warehouse"))].reposting_status = True + key = (args[i].get("item_code"), args[i].get("warehouse")) + if distinct_item_warehouses.get(key): + distinct_item_warehouses[key].reposting_status = True if obj.new_items_found: for _item_wh, data in distinct_item_warehouses.items():