From 26611475f6fd63eda6bbe3fea4a3b1c754efe68b Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 7 Apr 2025 17:17:42 +0530 Subject: [PATCH] fix: restrict customer change if creating from opportunity (cherry picked from commit dc4819e89773c7e74e09928d0d91c45a83a87117) --- erpnext/selling/doctype/quotation/quotation.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js index 03665b48a85..b9d46e0b84b 100644 --- a/erpnext/selling/doctype/quotation/quotation.js +++ b/erpnext/selling/doctype/quotation/quotation.js @@ -69,6 +69,8 @@ frappe.ui.form.on("Quotation", { erpnext.selling.QuotationController = class QuotationController extends erpnext.selling.SellingController { onload(doc, dt, dn) { super.onload(doc, dt, dn); + + this.frm.trigger("disable_customer_if_creating_from_opportunity"); } party_name() { var me = this; @@ -373,6 +375,12 @@ erpnext.selling.QuotationController = class QuotationController extends erpnext. ); } } + + disable_customer_if_creating_from_opportunity(doc) { + if (doc.opportunity) { + this.frm.set_df_property("party_name", "read_only", 1); + } + } }; cur_frm.script_manager.make(erpnext.selling.QuotationController);