diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py index 439ad57f6f0..d22174256c4 100644 --- a/erpnext/projects/doctype/project/project.py +++ b/erpnext/projects/doctype/project/project.py @@ -15,7 +15,7 @@ class Project(Document): def onload(self): """Load project tasks for quick view""" - if not self.get("tasks"): + if not self.get('__unsaved') and not self.get("tasks"): self.load_tasks() self.set_onload('activity_summary', frappe.db.sql('''select activity_type, sum(hours) as total_hours @@ -151,6 +151,10 @@ class Project(Document): frappe.sendmail(user.user, subject=_("Project Collaboration Invitation"), content=content.format(*messages)) user.welcome_email_sent=1 + def on_update(self): + self.load_tasks() + self.sync_tasks() + def get_timeline_data(doctype, name): '''Return timeline for attendance''' return dict(frappe.db.sql('''select unix_timestamp(from_time), count(*)