added report button in todo page
This commit is contained in:
parent
bdf4bcc2ed
commit
b60aef5595
@ -2,7 +2,8 @@ from __future__ import unicode_literals
|
|||||||
import webnotes
|
import webnotes
|
||||||
from webnotes.widgets.reportview import execute as runreport
|
from webnotes.widgets.reportview import execute as runreport
|
||||||
|
|
||||||
def execute(filters={}):
|
def execute(filters=None):
|
||||||
|
if not filters: filters = {}
|
||||||
employees = runreport(doctype="Employee", fields=["name", "employee_name", "department"])
|
employees = runreport(doctype="Employee", fields=["name", "employee_name", "department"])
|
||||||
leave_types = webnotes.conn.sql_list("select name from `tabLeave Type`")
|
leave_types = webnotes.conn.sql_list("select name from `tabLeave Type`")
|
||||||
|
|
||||||
|
8
patches/february_2013/p08_todo_query_report.py
Normal file
8
patches/february_2013/p08_todo_query_report.py
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import webnotes
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
webnotes.clear_perms("Report")
|
||||||
|
webnotes.clear_perms("ToDo")
|
||||||
|
webnotes.reload_doc("core", "doctype", "report")
|
||||||
|
webnotes.reload_doc("core", "doctype", "todo")
|
||||||
|
webnotes.reload_doc("core", "report", "todo")
|
@ -193,5 +193,6 @@ patch_list = [
|
|||||||
"patches.february_2013.repost_reserved_qty",
|
"patches.february_2013.repost_reserved_qty",
|
||||||
"execute:webnotes.reload_doc('core', 'doctype', 'report') # 2013-02-25",
|
"execute:webnotes.reload_doc('core', 'doctype', 'report') # 2013-02-25",
|
||||||
"execute:webnotes.conn.sql(\"update `tabReport` set report_type=if(ifnull(query, '')='', 'Report Builder', 'Query Report') where is_standard='No'\")",
|
"execute:webnotes.conn.sql(\"update `tabReport` set report_type=if(ifnull(query, '')='', 'Report Builder', 'Query Report') where is_standard='No'\")",
|
||||||
"execute:webnotes.conn.sql(\"update `tabReport` set report_name=name where ifnull(report_name,'')='' and is_standard='No'\")"
|
"execute:webnotes.conn.sql(\"update `tabReport` set report_name=name where ifnull(report_name,'')='' and is_standard='No'\")",
|
||||||
|
"patches.february_2013.p08_todo_query_report",
|
||||||
]
|
]
|
@ -194,6 +194,12 @@ wn.pages.todo.onload = function(wrapper) {
|
|||||||
}, 'icon-plus');
|
}, 'icon-plus');
|
||||||
wrapper.appframe.add_ripped_paper_effect(wrapper);
|
wrapper.appframe.add_ripped_paper_effect(wrapper);
|
||||||
|
|
||||||
|
// show report button for System Manager
|
||||||
|
if(wn.boot.profile.roles.indexOf("System Manager") !== -1) {
|
||||||
|
wrapper.appframe.add_button("Report", function() { wn.set_route("query-report", "todo"); },
|
||||||
|
"icon-table");
|
||||||
|
}
|
||||||
|
|
||||||
// load todos
|
// load todos
|
||||||
erpnext.todo.refresh();
|
erpnext.todo.refresh();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user