From 09a53376bb2249e7715d11c6098edd0ed6e0d847 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 12 Nov 2012 12:53:44 +0530 Subject: [PATCH 1/2] query-report patch, now report manager can save, but must give a new name if standard report --- .../employeewise_balance_leave_report.py | 33 ------------------- patches/november_2012/report_permissions.py | 6 ++++ patches/patch_list.py | 4 +++ 3 files changed, 10 insertions(+), 33 deletions(-) delete mode 100644 patches/before_jan_2012/employeewise_balance_leave_report.py create mode 100644 patches/november_2012/report_permissions.py diff --git a/patches/before_jan_2012/employeewise_balance_leave_report.py b/patches/before_jan_2012/employeewise_balance_leave_report.py deleted file mode 100644 index 45b00ae7bf..0000000000 --- a/patches/before_jan_2012/employeewise_balance_leave_report.py +++ /dev/null @@ -1,33 +0,0 @@ -# ERPNext - web based ERP (http://erpnext.com) -# Copyright (C) 2012 Web Notes Technologies Pvt Ltd -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -from __future__ import unicode_literals -""" - This patch changes criteria name - of search criteria "employeewise_balance_leave_report" - from "Employeewise Balance Leave Report" - to "Employee Leave Balance Report" - - This patch never worked!!! -""" -def execute(): - from webnotes.model.doc import Document - from webnotes.modules import reload_doc - reload_doc('hr', 'search_criteria', 'employeewise_balance_leave_report') - d = Document('Search Criteria', 'employeewise_balance_leave_report') - d.criteria_name = 'Employee Leave Balance Report' - d.description = 'Employeewise Balance Leave Report' - d.save() diff --git a/patches/november_2012/report_permissions.py b/patches/november_2012/report_permissions.py new file mode 100644 index 0000000000..061976160a --- /dev/null +++ b/patches/november_2012/report_permissions.py @@ -0,0 +1,6 @@ +import webnotes + +def execute(): + webnotes.conn.sql("""update tabDocPerm set `write`=1 where + parent='Report' + and role in ('Administrator', 'Report Manager', 'System Manager')""") \ No newline at end of file diff --git a/patches/patch_list.py b/patches/patch_list.py index 1a9ebb1134..abf7fae917 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -659,4 +659,8 @@ patch_list = [ 'patch_module': 'patches.november_2012', 'patch_file': 'rename_employee_leave_balance_report', }, + { + 'patch_module': 'patches.november_2012', + 'patch_file': 'report_permissions', + }, ] From d1784cca0094924f54b8b322127df93cedfcfc6e Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 12 Nov 2012 12:57:42 +0530 Subject: [PATCH 2/2] passing server date in boot and checking expiry against the server date --- public/js/startup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/startup.js b/public/js/startup.js index 1d43f41f9d..c845ab2a65 100644 --- a/public/js/startup.js +++ b/public/js/startup.js @@ -61,7 +61,7 @@ erpnext.startup.start = function() { erpnext.complete_setup.show(); } if(wn.boot.expires_on && in_list(user_roles, 'System Manager')) { - var today = dateutil.str_to_obj(dateutil.get_today()); + var today = dateutil.str_to_obj(wn.boot.server_date); var expires_on = dateutil.str_to_obj(wn.boot.expires_on); var diff = dateutil.get_diff(expires_on, today); if (0 <= diff && diff <= 15) {