fix(demo): removed toolbar eventlistener (#52171)

This commit is contained in:
Diptanil Saha
2026-01-29 11:27:12 +05:30
committed by GitHub
parent 1a4ecba742
commit e11ba21b42

View File

@@ -1,11 +1,5 @@
frappe.provide("erpnext.demo");
$(document).on("toolbar_setup", function () {
if (frappe.boot.sysdefaults.demo_company) {
render_clear_demo_action();
}
});
$(document).on("desktop_screen", function (event, data) {
data.desktop.add_menu_item({
label: __("Clear Demo Data"),
@@ -19,16 +13,6 @@ $(document).on("desktop_screen", function (event, data) {
});
});
function render_clear_demo_action() {
let demo_action = $(
`<a class="dropdown-item" onclick="return erpnext.demo.clear_demo()">
${__("Clear Demo Data")}
</a>`
);
demo_action.appendTo($("#toolbar-user"));
}
erpnext.demo.clear_demo = function () {
frappe.confirm(__("Are you sure you want to clear all demo data?"), () => {
frappe.call({