Skip to content

Commit 554aeb9

Browse files
feat: clear demo data from desktop screen (backport #52128) (#52150)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Soham Kulkarni <77533095+sokumon@users.noreply.github.com>
1 parent 6209d63 commit 554aeb9

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

erpnext/public/js/utils/demo.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@ $(document).on("toolbar_setup", function () {
66
}
77
});
88

9+
$(document).on("desktop_screen", function (event, data) {
10+
data.desktop.add_menu_item({
11+
label: __("Clear Demo Data"),
12+
icon: "trash",
13+
condition: function () {
14+
return frappe.boot.sysdefaults.demo_company;
15+
},
16+
onClick: function () {
17+
return erpnext.demo.clear_demo();
18+
},
19+
});
20+
});
21+
922
function render_clear_demo_action() {
1023
let demo_action = $(
1124
`<a class="dropdown-item" onclick="return erpnext.demo.clear_demo()">

0 commit comments

Comments
 (0)