fix(issue): Replace Make buttons on Issue and Task with a dashboard
This commit is contained in:
parent
bf7c69f3c4
commit
f4bce6a66e
@ -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() {
|
||||
|
19
erpnext/projects/doctype/task/task_dashboard.py
Normal file
19
erpnext/projects/doctype/task/task_dashboard.py
Normal 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']
|
||||
}
|
||||
]
|
||||
}
|
@ -4,10 +4,6 @@ frappe.ui.form.on("Issue", {
|
||||
},
|
||||
|
||||
refresh: function (frm) {
|
||||
frm.add_custom_button(__("Task"), function () {
|
||||
frappe.set_route("List", "Task", { "issue": frm.doc.name });
|
||||
}, __("View"));
|
||||
|
||||
if (frm.doc.status !== "Closed") {
|
||||
frm.add_custom_button(__("Close"), function () {
|
||||
frm.set_value("status", "Closed");
|
||||
|
15
erpnext/support/doctype/issue/issue_dashboard.py
Normal file
15
erpnext/support/doctype/issue/issue_dashboard.py
Normal file
@ -0,0 +1,15 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'issue',
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Activity'),
|
||||
'items': ['Task']
|
||||
}
|
||||
]
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user