From 91bcefef8ceb43a993989d613e6f6cf7cbba63c9 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 28 Apr 2025 19:38:27 +0530 Subject: [PATCH] fix: validation if no stock ledger entries against stock reco (backport #47292) (#47293) fix: validation if no stock ledger entries against stock reco (#47292) (cherry picked from commit 3d36d0b1df46008d9cec73393968a77d06aafced) Co-authored-by: rohitwaghchaure --- .../doctype/stock_reconciliation/stock_reconciliation.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py index c3d0480e820..0c28afe07e4 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py @@ -726,6 +726,12 @@ class StockReconciliation(StockController): ) self.make_sl_entries(sl_entries, allow_negative_stock=allow_negative_stock) + elif self.docstatus == 1: + frappe.throw( + _( + "No stock ledger entries were created. Please set the quantity or valuation rate for the items properly and try again." + ) + ) def make_adjustment_entry(self, row, sl_entries): from erpnext.stock.stock_ledger import get_stock_value_difference