From 4e74831a08500787bc5e33b0e5890ef163e2b98f Mon Sep 17 00:00:00 2001 From: pandiyan Date: Thu, 27 Aug 2026 17:34:27 +0530 Subject: [PATCH] fix(selling): check quotation write permission before marking lost (#58493) (cherry picked from commit 5f99a3418df290344e00da58a2325404fdc6d5e1) # Conflicts: # erpnext/selling/doctype/quotation/quotation.py --- erpnext/selling/doctype/quotation/quotation.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index 25ff70f9491..302c44e8d8d 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -261,7 +261,11 @@ class Quotation(SellingController): opp.set_status(status=status, update=True) @frappe.whitelist() - def declare_enquiry_lost(self, lost_reasons_list, competitors, detailed_reason=None): + def declare_enquiry_lost( + self, lost_reasons_list: list, competitors: list, detailed_reason: str | None = None + ): + self.check_permission("write") + 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]