mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-09 00:01:18 +00:00
cannot close task if dependent task are not closed / cancelled (#20433)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user