Update status if tasks have been completed (#14601)

This commit is contained in:
Shreya Shah 2018-06-20 17:52:21 +05:30 committed by Nabin Hait
parent 616a6d2bc2
commit b125ba9ed8

View File

@ -160,6 +160,10 @@ class Project(Document):
for row in weighted_progress:
pct_complete += row["progress"] * row["task_weight"]
self.percent_complete = flt(flt(pct_complete), 2)
if self.percent_complete == 100:
self.status = "Completed"
elif not self.status == "Cancelled":
self.status = "Open"
def update_costing(self):
from_time_sheet = frappe.db.sql("""select