check for existing task before appending to child table (#15183)

This commit is contained in:
Valmik
2018-08-22 14:46:33 +05:30
committed by Nabin Hait
parent 427a1301b7
commit 6ad16db88c

1
erpnext/projects/doctype/task/task.py Normal file → Executable file
View File

@@ -141,6 +141,7 @@ class Task(NestedSet):
def populate_depends_on(self): def populate_depends_on(self):
if self.parent_task: if self.parent_task:
parent = frappe.get_doc('Task', self.parent_task) parent = frappe.get_doc('Task', self.parent_task)
if not self.name in [row.task for row in parent.depends_on]:
parent.append("depends_on", { parent.append("depends_on", {
"doctype": "Task Depends On", "doctype": "Task Depends On",
"task": self.name, "task": self.name,