From a3058bf8ccc9cf2e828a1cf45aa2b17900e59528 Mon Sep 17 00:00:00 2001 From: Kavin <78342682+kavin0411@users.noreply.github.com> Date: Sat, 1 Nov 2025 18:16:20 +0530 Subject: [PATCH] fix: handle None in last_valuation_rate check --- erpnext/stock/stock_ledger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index c94b9869b11..53df3d1d6f7 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -1927,7 +1927,7 @@ def get_valuation_rate( ) last_valuation_rate = query.run() - if last_valuation_rate: + if last_valuation_rate and last_valuation_rate[0][0] is not None: return flt(last_valuation_rate[0][0]) # Get moving average rate of a specific batch number