fix: Added 'Manual' % Complete Method in Project (#19175)

Added additional '% Complete Method' in Project so that Project can be set to 'Completed' irrespective of presence of Tasks
This commit is contained in:
Marica 2019-09-30 15:11:15 +05:30 committed by Nabin Hait
parent 201bcaf2ca
commit 147af15268
2 changed files with 6 additions and 1 deletions

View File

@ -108,7 +108,7 @@
"fieldname": "percent_complete_method",
"fieldtype": "Select",
"label": "% Complete Method",
"options": "Task Completion\nTask Progress\nTask Weight"
"options": "Manual\nTask Completion\nTask Progress\nTask Weight"
},
{
"bold": 1,

View File

@ -87,6 +87,11 @@ class Project(Document):
frappe.db.set_value("Sales Order", self.sales_order, "project", self.name)
def update_percent_complete(self):
if self.percent_complete_method == "Manual":
if self.status == "Completed":
self.percent_complete = 100
return
total = frappe.db.count('Task', dict(project=self.name))
if not total: