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
This commit is contained in:
parent
3c7683e6a1
commit
0ff005fcc5
1 changed files with 2 additions and 2 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue