From b60aef5595694a865eef50dbac56dbd94097a699 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 25 Feb 2013 15:22:20 +0530 Subject: [PATCH 1/2] added report button in todo page --- .../employee_leave_balance/employee_leave_balance.py | 3 ++- patches/february_2013/p08_todo_query_report.py | 8 ++++++++ patches/patch_list.py | 3 ++- utilities/page/todo/todo.js | 6 ++++++ 4 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 patches/february_2013/p08_todo_query_report.py diff --git a/hr/report/employee_leave_balance/employee_leave_balance.py b/hr/report/employee_leave_balance/employee_leave_balance.py index 23b4bd438f..d7ad472568 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 @@ from __future__ import unicode_literals 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 0000000000..6b25aba9ca --- /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 6603648bea..1e30b7ecba 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -193,5 +193,6 @@ patch_list = [ "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 cad5fbd28b..fa82002ea7 100644 --- a/utilities/page/todo/todo.js +++ b/utilities/page/todo/todo.js @@ -193,6 +193,12 @@ wn.pages.todo.onload = function(wrapper) { 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(); From 7f27d34f81f973882f2e3867379691e060d058c9 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 25 Feb 2013 15:38:28 +0530 Subject: [PATCH 2/2] Material Request - Print Heading as a Link field --- stock/doctype/material_request/material_request.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stock/doctype/material_request/material_request.txt b/stock/doctype/material_request/material_request.txt index 0668bdf5f1..f2e6b3573a 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