fix: Add confirmation box before removal

This commit is contained in:
14987 2024-01-08 13:49:22 +05:30
parent ab915e3a81
commit f3af2d054e
No known key found for this signature in database
GPG key ID: ED4A241EAB170273

View file

@ -1818,12 +1818,21 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList {
return {
label: __("Clear Assignment", null, "Button in list view actions menu"),
action: () => {
this.disable_list_update = true;
bulk_operations.clear_assignment(this.get_checked_items(true), () => {
this.disable_list_update = false;
this.clear_checked_items();
this.refresh();
});
frappe.confirm(
"Are you sure you want to clear the assignments?",
() => {
this.disable_list_update = true;
bulk_operations.clear_assignment(this.get_checked_items(true), () => {
this.disable_list_update = false;
this.clear_checked_items();
this.refresh();
});
},
() => {
this.clear_checked_items();
this.refresh();
}
);
},
standard: true,
};