From fe61a46aadd482ac1cc85a964964911ddbf1d0d5 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 --- 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 bbc3d4d1db0..c6a1bbd2f96 100644 --- a/erpnext/selling/doctype/quotation/quotation.js +++ b/erpnext/selling/doctype/quotation/quotation.js @@ -70,6 +70,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() { @@ -407,6 +409,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); -- GitLab