diff --git a/erpnext/config/projects.py b/erpnext/config/projects.py index e6c95786dd3..87174a4fe83 100644 --- a/erpnext/config/projects.py +++ b/erpnext/config/projects.py @@ -19,7 +19,7 @@ def get_data(): }, { "type": "report", - "route": "Gantt/Task", + "route": "List/Task/Gantt", "doctype": "Task", "name": "Gantt Chart", "description": _("Gantt chart of all tasks.") diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 36014e7bcab..bbabcb87842 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -334,3 +334,4 @@ erpnext.patches.v7_1.update_portal_roles erpnext.patches.v7_1.set_total_amount_currency_in_je finally:erpnext.patches.v7_0.update_timesheet_communications erpnext.patches.v7_0.update_status_of_zero_amount_sales_order +erpnext.patches.v7_1.add_field_for_task_dependent diff --git a/erpnext/patches/v7_1/add_field_for_task_dependent.py b/erpnext/patches/v7_1/add_field_for_task_dependent.py new file mode 100644 index 00000000000..96daa139181 --- /dev/null +++ b/erpnext/patches/v7_1/add_field_for_task_dependent.py @@ -0,0 +1,9 @@ +import frappe + +def execute(): + frappe.reload_doctype('Task') + for t in frappe.get_all('Task', fields=['name']): + task = frappe.get_doc('Task', t.name) + task.update_depends_on() + if task.depends_on_tasks: + task.db_set('depends_on_tasks', task.depends_on_tasks, update_modified=False) diff --git a/erpnext/projects/doctype/task/task.json b/erpnext/projects/doctype/task/task.json index 499bd8a97c2..46c874677e5 100644 --- a/erpnext/projects/doctype/task/task.json +++ b/erpnext/projects/doctype/task/task.json @@ -282,6 +282,32 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "progress", + "fieldtype": "Percent", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Progress", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_on_submit": 0, "bold": 0, @@ -390,6 +416,32 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "depends_on_tasks", + "fieldtype": "Read Only", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "depends_on_tasks", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_on_submit": 0, "bold": 0, @@ -475,32 +527,6 @@ "set_only_once": 0, "unique": 0 }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "progress", - "fieldtype": "Percent", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Progress", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, { "allow_on_submit": 0, "bold": 0, @@ -828,7 +854,7 @@ "istable": 0, "max_attachments": 5, "menu_index": 0, - "modified": "2016-09-22 18:16:50.339542", + "modified": "2016-10-03 15:12:56.078675", "modified_by": "Administrator", "module": "Projects", "name": "Task", @@ -844,6 +870,7 @@ "export": 0, "if_owner": 0, "import": 0, + "is_custom": 0, "permlevel": 0, "print": 1, "read": 1, diff --git a/erpnext/projects/doctype/task/task.py b/erpnext/projects/doctype/task/task.py index b918e3aa503..34b9ed5884c 100644 --- a/erpnext/projects/doctype/task/task.py +++ b/erpnext/projects/doctype/task/task.py @@ -29,6 +29,7 @@ class Task(Document): def validate(self): self.validate_dates() self.validate_status() + self.update_depends_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): @@ -46,6 +47,12 @@ class Task(Document): from frappe.desk.form.assign_to import clear clear(self.doctype, self.name) + def update_depends_on(self): + depends_on_tasks = "" + for d in self.depends_on: + depends_on_tasks += d.task + "," + self.depends_on_tasks = depends_on_tasks + def on_update(self): self.check_recursion() self.reschedule_dependent_tasks() @@ -156,5 +163,3 @@ def set_tasks_as_overdue(): and exp_end_date < CURDATE() and `status` not in ('Closed', 'Cancelled')""") - - diff --git a/erpnext/projects/doctype/task/task_list.js b/erpnext/projects/doctype/task/task_list.js index d9e8f55ef01..4bfa781ca01 100644 --- a/erpnext/projects/doctype/task/task_list.js +++ b/erpnext/projects/doctype/task/task_list.js @@ -1,5 +1,6 @@ frappe.listview_settings['Task'] = { - add_fields: ["project", "status", "priority", "exp_start_date", "exp_end_date", "subject", "progress"], + add_fields: ["project", "status", "priority", "exp_start_date", + "exp_end_date", "subject", "progress", "depends_on_tasks"], filters: [["status", "=", "Open"]], onload: function(listview) { var method = "erpnext.projects.doctype.task.task.set_multiple_status";