| frappe.provide("erpnext.demo"); |
| $(document).on("toolbar_setup", function () { |
| if (frappe.boot.sysdefaults.demo_company) { |
| render_clear_demo_action(); |
| function render_clear_demo_action() { |
| `<a class="dropdown-item" onclick="return erpnext.demo.clear_demo()"> |
| demo_action.appendTo($("#toolbar-user")); |
| erpnext.demo.clear_demo = function () { |
| frappe.confirm(__("Are you sure you want to clear all demo data?"), () => { |
| method: "erpnext.setup.demo.clear_demo_data", |
| freeze_message: __("Clearing Demo Data..."), |
| frappe.ui.toolbar.clear_cache(); |
| message: __("Demo data cleared"), |