Convert Todo Delete Button to Close Button

In the Todo screen, when a Todo is selected, the Delete button shows up in bright red. How do I change that button to a “Close” button? That is a more appropriate action for a Todo item.

You are at List view, showing all the Documents under a doctype Todo. When you select at list view level, it will show delete. This is normal.

You need to click on the Todo… Inventory request and once it open up, you may change the status or cancel it.

@mslake ERPNext / Frappe Gives the facility to customise docs and even create custom buttons for actions. But you are asking for is to change the default behavior of the system. This is not what the button or the screen is meant for.

Hi @mslake

If you want to add new button “Close” . You need to add custom script list and api to do it,

Selection_040

hooks.py

doctype_list_js = {
  "ToDo" : "custom_scripts/todo_list.js"
}

todo_list.js and yourapp.api.close_todo => api of your app

frappe.listview_settings['ToDo'] = {
	onload: function (listview) {
		var method = "yourapp.api.close_todo";
		listview.page.add_menu_item(__("Close"), function() {
			listview.call_for_selected_items(method, {"status": "Closed"});
		});
	}
}
1 Like

Thank you. This is what I was looking for.

1 Like