fix(issue): Replace Make buttons on Issue and Task with a dashboard

This commit is contained in:
Rohan Bansal 2019-02-18 12:53:11 +05:30
parent bf7c69f3c4
commit f4bce6a66e
4 changed files with 34 additions and 17 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

@ -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']
}
]
}

View File

@ -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");

View File

@ -0,0 +1,15 @@
from __future__ import unicode_literals
from frappe import _
def get_data():
return {
'fieldname': 'issue',
'transactions': [
{
'label': _('Activity'),
'items': ['Task']
}
]
}