Merge pull request #16673 from Alchez/feat-task-from-issue

feat(issue): Create and view Tasks from Issues
This commit is contained in:
Rushabh Mehta
2019-03-15 08:55:20 +05:30
committed by GitHub
7 changed files with 175 additions and 81 deletions

View File

@@ -35,19 +35,6 @@ frappe.ui.form.on("Task", {
}
if(!doc.__islocal) {
if(frappe.model.can_read("Timesheet")) {
frm.add_custom_button(__("Timesheet"), function() {
frappe.route_options = {"project": doc.project, "task": doc.name}
frappe.set_route("List", "Timesheet");
}, __("View"), true);
}
if(frappe.model.can_read("Expense Claim")) {
frm.add_custom_button(__("Expense Claims"), function() {
frappe.route_options = {"project": doc.project, "task": doc.name}
frappe.set_route("List", "Expense Claim");
}, __("View"), true);
}
if(frm.perm[0].write) {
if(frm.doc.status!=="Completed" && frm.doc.status!=="Cancelled") {
frm.add_custom_button(__("Completed"), function() {

View File

@@ -79,6 +79,39 @@
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "issue",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Issue",
"length": 0,
"no_copy": 0,
"options": "Issue",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
@@ -213,6 +246,38 @@
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "color",
"fieldtype": "Color",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Color",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
@@ -251,11 +316,11 @@
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"collapsible_depends_on": "",
"collapsible": 1,
"collapsible_depends_on": "eval:doc.__islocal",
"columns": 0,
"depends_on": "",
"fieldname": "section_break_10",
"fieldname": "sb_timeline",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -264,6 +329,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Timeline",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -513,38 +579,6 @@
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "color",
"fieldtype": "Color",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Color",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
@@ -554,7 +588,7 @@
"collapsible_depends_on": "",
"columns": 0,
"depends_on": "",
"fieldname": "section_break0",
"fieldname": "sb_details",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -563,10 +597,11 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Details",
"length": 0,
"no_copy": 0,
"oldfieldtype": "Section Break",
"options": "Simple",
"options": "",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
@@ -596,7 +631,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Details",
"label": "Task Description",
"length": 0,
"no_copy": 0,
"oldfieldname": "description",
@@ -624,7 +659,7 @@
"collapsible_depends_on": "",
"columns": 0,
"depends_on": "",
"fieldname": "section_break",
"fieldname": "sb_depends_on",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -726,7 +761,7 @@
"columns": 0,
"depends_on": "",
"description": "",
"fieldname": "actual",
"fieldname": "sb_actual",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -893,10 +928,10 @@
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"collapsible": 1,
"columns": 0,
"depends_on": "",
"fieldname": "section_break_17",
"fieldname": "sb_costing",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -905,6 +940,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Costing",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -1058,9 +1094,9 @@
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"collapsible": 1,
"columns": 0,
"fieldname": "more_details",
"fieldname": "sb_more_info",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -1069,7 +1105,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "",
"label": "More Info",
"length": 0,
"no_copy": 0,
"permlevel": 0,

View File

@@ -0,0 +1,19 @@
from __future__ import unicode_literals
from frappe import _
def get_data():
return {
'fieldname': 'task',
'transactions': [
{
'label': _('Activity'),
'items': ['Timesheet']
},
{
'label': _('Accounting'),
'items': ['Expense Claim']
}
]
}