forked from frappe/crm
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: added reset form script button to reset erpnext form script
- Loading branch information
1 parent
2336cc7
commit 01411cd
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors | ||
// For license information, please see license.txt | ||
|
||
frappe.ui.form.on("ERPNext CRM Settings", { | ||
refresh(frm) { | ||
if (!frm.doc.enabled) return; | ||
frm.add_custom_button(__("Reset ERPNext Form Script"), () => { | ||
frappe.confirm( | ||
__( | ||
"Are you sure you want to reset 'Create Quotation from CRM Deal' Form Script?" | ||
), | ||
() => frm.trigger("update_form_script") | ||
); | ||
}); | ||
}, | ||
async update_form_script() { | ||
let script = await frappe.call( | ||
"crm.fcrm.doctype.erpnext_crm_settings.erpnext_crm_settings.get_crm_form_script" | ||
); | ||
if (script.message) { | ||
let form_script = await frappe.db.set_value( | ||
"CRM Form Script", | ||
"Create Quotation from CRM Deal", | ||
"script", | ||
script.message | ||
); | ||
if (form_script.message) { | ||
frappe.msgprint(__("Form Script updated successfully")); | ||
} | ||
} | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters