fix: cannot complete task if dependent task are not completed / cancelled (#20437)
diff --git a/erpnext/projects/doctype/task/task.py b/erpnext/projects/doctype/task/task.py
index 45f2681..d56bb23 100755
--- a/erpnext/projects/doctype/task/task.py
+++ b/erpnext/projects/doctype/task/task.py
@@ -56,8 +56,8 @@
def validate_status(self):
if self.status!=self.get_db_value("status") and self.status == "Completed":
for d in self.depends_on:
- if frappe.db.get_value("Task", d.task, "status") != "Completed":
- frappe.throw(_("Cannot close task {0} as its dependant task {1} is not closed.").format(frappe.bold(self.name), frappe.bold(d.task)))
+ if frappe.db.get_value("Task", d.task, "status") not in ("Completed", "Cancelled"):
+ frappe.throw(_("Cannot complete task {0} as its dependant task {1} are not ccompleted / cancelled.").format(frappe.bold(self.name), frappe.bold(d.task)))
close_all_assignments(self.doctype, self.name)