fix(project): If Project has no Tasks, let the status be set as Completed (#15639)
This commit is contained in:
parent
14c6ab0ee9
commit
3855156b7d
@ -187,6 +187,7 @@ class Project(Document):
|
||||
frappe.db.set_value("Sales Order", self.sales_order, "project", self.name)
|
||||
|
||||
def update_percent_complete(self):
|
||||
if not self.tasks: return
|
||||
total = frappe.db.sql("""select count(name) from tabTask where project=%s""", self.name)[0][0]
|
||||
if not total and self.percent_complete:
|
||||
self.percent_complete = 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user