cannot close task if dependent task are not closed / cancelled (#20433)

This commit is contained in:
Nabin Hait
2020-01-28 14:08:31 +05:30
committed by GitHub
parent 41d2357dc4
commit 1c5df5dede

View File

@@ -47,8 +47,8 @@ class Task(NestedSet):
def validate_status(self):
if self.status!=self.get_db_value("status") and self.status == "Closed":
for d in self.depends_on:
if frappe.db.get_value("Task", d.task, "status") != "Closed":
frappe.throw(_("Cannot close task as its dependant task {0} is not closed.").format(d.task))
if frappe.db.get_value("Task", d.task, "status") not in ("Closed", "Cancelled"):
frappe.throw(_("Cannot close task as its dependant task {0} is not closed/cancelled.").format(d.task))
from frappe.desk.form.assign_to import clear
clear(self.doctype, self.name)