fix: restrict customer change if creating from opportunity

(cherry picked from commit dc4819e897)
This commit is contained in:
Shariq Ansari
2025-04-07 17:17:42 +05:30
committed by Mergify
parent 5b3ae9508a
commit 26611475f6

View File

@@ -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);