fix(UX): Cancel tasks if project is cancelled (#17497)

This commit is contained in:
Faris Ansari 2019-05-07 12:37:38 +05:30 committed by Suraj Shetty
parent 3083d8d453
commit a90fe810b3

View File

@ -109,6 +109,18 @@ frappe.ui.form.on("Project", {
}
});
},
status: function(frm) {
if (frm.doc.status === 'Cancelled') {
frappe.confirm(__('Set tasks in this project as cancelled?'), () => {
frm.doc.tasks = frm.doc.tasks.map(task => {
task.status = 'Cancelled';
return task;
});
frm.refresh_field('tasks');
});
}
}
});
frappe.ui.form.on("Project Task", {