From 0ff005fcc55e8ee0762fdb60a94b6a25233a6483 Mon Sep 17 00:00:00 2001 From: ci2014 Date: Fri, 10 Nov 2017 07:54:20 +0100 Subject: [PATCH] More flexible close / reopen button for ToDo (#4433) Make the close and reopen button for flexible for multiple status and custom status, like here: https://github.com/frappe/erpnext/pull/11381 --- frappe/desk/doctype/todo/todo.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/desk/doctype/todo/todo.js b/frappe/desk/doctype/todo/todo.js index 8a13103311..0317281371 100644 --- a/frappe/desk/doctype/todo/todo.js +++ b/frappe/desk/doctype/todo/todo.js @@ -18,7 +18,7 @@ frappe.ui.form.on("ToDo", { } if (!frm.doc.__islocal) { - if(frm.doc.status=="Open") { + if(frm.doc.status!=="Closed") { frm.add_custom_button(__("Close"), function() { frm.set_value("status", "Closed"); frm.save(null, function() { @@ -27,7 +27,7 @@ frappe.ui.form.on("ToDo", { }); }, "fa fa-check", "btn-success"); } else { - frm.add_custom_button(__("Re-open"), function() { + frm.add_custom_button(__("Reopen"), function() { frm.set_value("status", "Open"); frm.save(); }, null, "btn-default");