Merge branch 'master' of github.com:webnotes/erpnext
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/stock/doctype/material_request/material_request.txt b/stock/doctype/material_request/material_request.txt
index 0668bdf..f2e6b35 100644
--- a/stock/doctype/material_request/material_request.txt
+++ b/stock/doctype/material_request/material_request.txt
@@ -1,8 +1,8 @@
 [
  {
-  "creation": "2013-02-20 13:25:31", 
+  "creation": "2013-02-21 14:15:25", 
   "docstatus": 0, 
-  "modified": "2013-02-21 10:59:09", 
+  "modified": "2013-02-25 15:38:02", 
   "modified_by": "Administrator", 
   "owner": "Administrator"
  }, 
@@ -326,7 +326,7 @@
   "allow_on_submit": 1, 
   "doctype": "DocField", 
   "fieldname": "select_print_heading", 
-  "fieldtype": "Select", 
+  "fieldtype": "Link", 
   "label": "Select Print Heading", 
   "options": "Print Heading", 
   "print_hide": 1
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();