fix: `Stock Reservation` validation in `Stock Settings`
diff --git a/erpnext/stock/doctype/stock_settings/stock_settings.py b/erpnext/stock/doctype/stock_settings/stock_settings.py
index f041e79..6e1d02c 100644
--- a/erpnext/stock/doctype/stock_settings/stock_settings.py
+++ b/erpnext/stock/doctype/stock_settings/stock_settings.py
@@ -108,7 +108,9 @@
"Stock Settings", "enable_stock_reservation"
)
- if db_enable_stock_reservation and frappe.db.count("Stock Reservation Entry"):
+ if db_enable_stock_reservation and frappe.db.exists(
+ "Stock Reservation Entry", {"docstatus": 1, "status": ["!=", "Delivered"]}
+ ):
frappe.throw(
_("As there are existing {0}, you can not change the value of {1}.").format(
frappe.bold("Stock Reservation Entries"), frappe.bold("Enable Stock Reservation")