From e23616f9ea0711137dd2ce3db054d317f266a6f9 Mon Sep 17 00:00:00 2001 From: thomasantony12 Date: Sun, 12 Oct 2025 18:05:29 +0530 Subject: [PATCH] chore: use get_single_value instead of get_cached_doc (cherry picked from commit fab7f9ee53ef1db331269c4ff087bced16820c3f) --- erpnext/stock/doctype/batch/batch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/batch/batch.py b/erpnext/stock/doctype/batch/batch.py index e81e9a2ff5a..6b3aa422772 100644 --- a/erpnext/stock/doctype/batch/batch.py +++ b/erpnext/stock/doctype/batch/batch.py @@ -253,7 +253,7 @@ def get_batch_qty( get_auto_batch_nos, ) - stock_settings = frappe.get_cached_doc("Stock Settings") + based_on = frappe.get_single_value("Stock Settings", "pick_serial_and_batch_based_on") batchwise_qty = defaultdict(float) kwargs = frappe._dict( { @@ -263,7 +263,7 @@ def get_batch_qty( "posting_date": posting_date, "posting_time": posting_time, "batch_no": batch_no, - "based_on": stock_settings.pick_serial_and_batch_based_on, + "based_on": based_on, "ignore_voucher_nos": ignore_voucher_nos, "for_stock_levels": for_stock_levels, "consider_negative_batches": consider_negative_batches,