From ebd35584b273ce7529b45e63f79dedd10c7e0a4e Mon Sep 17 00:00:00 2001 From: Shllokkk Date: Wed, 28 Oct 2026 17:48:24 +0530 Subject: [PATCH] fix: only allow a submitted quotation to be set as Lost --- erpnext/selling/doctype/quotation/quotation.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index 856ba33a486..4aadeb38ea6 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -263,6 +263,9 @@ class Quotation(SellingController): ): self.check_permission("write") + if self.docstatus != 1: + frappe.throw(_("Only a submitted Quotation can be set as Lost.")) + if not (self.is_fully_ordered() or self.is_partially_ordered()): get_lost_reasons = frappe.get_list("Quotation Lost Reason", fields=["name"]) lost_reasons_lst = [reason.get("name") for reason in get_lost_reasons]