feat: Delayed Tasks Summary (#25024)

* feat: delayed deliverables summary

* fix: sider

* fix: renamed to delayed tasks

* fix: renamed test

* fix: test

* fix: sider

* fix: dates, validations and chart

* fix: space and column width

* feat: Sort tasks by descending order of delay

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
This commit is contained in:
Jannat Patel
2021-04-19 12:46:14 +05:30
committed by GitHub
parent ac8a467b0a
commit 119b27b97f
8 changed files with 286 additions and 4 deletions

View File

@@ -11,15 +11,16 @@
"project",
"issue",
"type",
"color",
"is_group",
"is_template",
"column_break0",
"status",
"priority",
"task_weight",
"completed_by",
"color",
"parent_task",
"completed_by",
"completed_on",
"sb_timeline",
"exp_start_date",
"expected_time",
@@ -358,6 +359,7 @@
"read_only": 1
},
{
"depends_on": "eval: doc.status == \"Completed\"",
"fieldname": "completed_by",
"fieldtype": "Link",
"label": "Completed By",
@@ -381,6 +383,13 @@
"fieldname": "duration",
"fieldtype": "Int",
"label": "Duration (Days)"
},
{
"depends_on": "eval: doc.status == \"Completed\"",
"fieldname": "completed_on",
"fieldtype": "Date",
"label": "Completed On",
"mandatory_depends_on": "eval: doc.status == \"Completed\""
}
],
"icon": "fa fa-check",
@@ -388,7 +397,7 @@
"is_tree": 1,
"links": [],
"max_attachments": 5,
"modified": "2020-12-28 11:32:58.714991",
"modified": "2021-04-16 12:46:51.556741",
"modified_by": "Administrator",
"module": "Projects",
"name": "Task",

View File

@@ -36,6 +36,7 @@ class Task(NestedSet):
self.validate_status()
self.update_depends_on()
self.validate_dependencies_for_template_task()
self.validate_completed_on()
def validate_dates(self):
if self.exp_start_date and self.exp_end_date and getdate(self.exp_start_date) > getdate(self.exp_end_date):
@@ -100,6 +101,10 @@ class Task(NestedSet):
dependent_task_format = """<a href="#Form/Task/{0}">{0}</a>""".format(task.task)
frappe.throw(_("Dependent Task {0} is not a Template Task").format(dependent_task_format))
def validate_completed_on(self):
if self.completed_on and getdate(self.completed_on) > getdate():
frappe.throw(_("Completed On cannot be greater than Today"))
def update_depends_on(self):
depends_on_tasks = self.depends_on_tasks or ""
for d in self.depends_on: