feat: unlink task from project on task deletion
This commit is contained in:
committed by
Nabin Hait
parent
5296ab1f87
commit
9f7fd16882
@@ -157,6 +157,12 @@ class Task(NestedSet):
|
|||||||
if check_if_child_exists(self.name):
|
if check_if_child_exists(self.name):
|
||||||
throw(_("Child Task exists for this Task. You can not delete this Task."))
|
throw(_("Child Task exists for this Task. You can not delete this Task."))
|
||||||
|
|
||||||
|
if self.project:
|
||||||
|
tasks = frappe.get_doc('Project', self.project).tasks
|
||||||
|
for task in tasks:
|
||||||
|
if (task.get('task_id') == self.name):
|
||||||
|
frappe.delete_doc('Project Task', task.name)
|
||||||
|
|
||||||
self.update_nsm_model()
|
self.update_nsm_model()
|
||||||
|
|
||||||
def update_status(self):
|
def update_status(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user