added report button in todo page
diff --git a/hr/report/employee_leave_balance/employee_leave_balance.py b/hr/report/employee_leave_balance/employee_leave_balance.py
index 23b4bd4..d7ad472 100644
--- a/hr/report/employee_leave_balance/employee_leave_balance.py
+++ b/hr/report/employee_leave_balance/employee_leave_balance.py
@@ -2,7 +2,8 @@
import webnotes
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"])
leave_types = webnotes.conn.sql_list("select name from `tabLeave Type`")
diff --git a/patches/february_2013/p08_todo_query_report.py b/patches/february_2013/p08_todo_query_report.py
new file mode 100644
index 0000000..6b25aba
--- /dev/null
+++ b/patches/february_2013/p08_todo_query_report.py
@@ -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")
diff --git a/patches/patch_list.py b/patches/patch_list.py
index 6603648..1e30b7e 100644
--- a/patches/patch_list.py
+++ b/patches/patch_list.py
@@ -193,5 +193,6 @@
"patches.february_2013.repost_reserved_qty",
"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_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",
]
\ No newline at end of file
diff --git a/utilities/page/todo/todo.js b/utilities/page/todo/todo.js
index cad5fbd..fa82002 100644
--- a/utilities/page/todo/todo.js
+++ b/utilities/page/todo/todo.js
@@ -193,6 +193,12 @@
date:get_today(), priority:'Medium', checked:0, description:''});
}, 'icon-plus');
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
erpnext.todo.refresh();