diff --git a/erpnext/patches.txt b/erpnext/patches.txt index c6472109b1..0f32a6dbf6 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -166,4 +166,6 @@ erpnext.patches.v5_0.portal_fixes erpnext.patches.v5_0.reset_values_in_tools execute:frappe.delete_doc("Page", "users") erpnext.patches.v5_0.update_material_transferred_for_manufacturing_again -erpnext.patches.v5_0.index_on_account_and_gl_entry \ No newline at end of file +erpnext.patches.v5_0.index_on_account_and_gl_entry +execute:frappe.db.sql("""delete from `tabProject Task`""") + diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py index 05e40388bf..0ba368d5ba 100644 --- a/erpnext/projects/doctype/project/project.py +++ b/erpnext/projects/doctype/project/project.py @@ -35,6 +35,7 @@ class Project(Document): def validate(self): self.validate_dates() self.sync_tasks() + self.tasks = [] def validate_dates(self): if self.expected_start_date and self.expected_end_date: @@ -70,8 +71,6 @@ class Project(Document): for t in frappe.get_all("Task", ["name"], {"project": self.name, "name": ("not in", task_names)}): frappe.delete_doc("Task", t.name) - self.tasks = [] - def update_percent_complete(self): total = frappe.db.sql("""select count(*) from tabTask where project=%s""", self.name)[0][0]