From 9597b1a69e965638d68c7018fc564ba71e9d4246 Mon Sep 17 00:00:00 2001 From: Nirmalrajaa K Date: Fri, 21 Feb 2025 14:57:16 +0530 Subject: [PATCH] fix: Batch Price gets updated only if it is a billed item --- erpnext/stock/get_item_details.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index 148ea784f3a..792b8c2478c 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -1095,7 +1095,8 @@ def get_batch_based_item_price(pctx: ItemPriceCtx | dict | str, item_code) -> fl if not item_price: item_price = get_item_price(pctx, item_code, ignore_party=True, force_batch_no=True) - if item_price and item_price[0].uom == pctx.uom and not pctx.get("items", [{}])[0].get("is_free_item", 0): + + if item_price and item_price[0].uom == pctx.uom and params.get("is_free_item") == 0: return item_price[0].price_list_rate return 0.0