From 92af22aa12cb2500a0c5ef135628fbbc68ef2369 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 18 Dec 2012 13:45:59 +0530 Subject: [PATCH] removed debug mode --- hr/doctype/leave_application/leave_application.js | 1 + hr/doctype/leave_application/leave_application.py | 4 ++-- hr/doctype/leave_application/leave_application.txt | 11 ++++++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/hr/doctype/leave_application/leave_application.js b/hr/doctype/leave_application/leave_application.js index 042cccad8da..7253bdba0a9 100755 --- a/hr/doctype/leave_application/leave_application.js +++ b/hr/doctype/leave_application/leave_application.js @@ -16,6 +16,7 @@ cur_frm.add_fetch('employee','employee_name','employee_name'); + cur_frm.cscript.onload = function(doc, dt, dn) { if(!doc.posting_date) set_multiple(dt,dn,{posting_date:get_today()}); diff --git a/hr/doctype/leave_application/leave_application.py b/hr/doctype/leave_application/leave_application.py index c0a51799fe4..d945367e79c 100755 --- a/hr/doctype/leave_application/leave_application.py +++ b/hr/doctype/leave_application/leave_application.py @@ -104,14 +104,14 @@ def get_leave_balance(employee, leave_type, fiscal_year): leave_all = webnotes.conn.sql("""select total_leaves_allocated from `tabLeave Allocation` where employee = %s and leave_type = %s and fiscal_year = %s and docstatus = 1""", (employee, - leave_type, fiscal_year), debug=1) + leave_type, fiscal_year)) leave_all = leave_all and flt(leave_all[0][0]) or 0 leave_app = webnotes.conn.sql("""select SUM(total_leave_days) from `tabLeave Application` where employee = %s and leave_type = %s and fiscal_year = %s - and docstatus = 1""", (employee, leave_type, fiscal_year), debug=1) + and docstatus = 1""", (employee, leave_type, fiscal_year)) leave_app = leave_app and flt(leave_app[0][0]) or 0 ret = {'leave_balance': leave_all - leave_app} diff --git a/hr/doctype/leave_application/leave_application.txt b/hr/doctype/leave_application/leave_application.txt index 2e4d7c20551..dce8539a51d 100644 --- a/hr/doctype/leave_application/leave_application.txt +++ b/hr/doctype/leave_application/leave_application.txt @@ -2,9 +2,9 @@ { "owner": "Administrator", "docstatus": 0, - "creation": "2012-12-07 18:27:12", + "creation": "2012-12-10 10:25:20", "modified_by": "Administrator", - "modified": "2012-12-07 18:47:48" + "modified": "2012-12-18 11:06:53" }, { "is_submittable": 1, @@ -160,7 +160,7 @@ "search_index": 0, "doctype": "DocField", "label": "Fiscal Year", - "options": "Link:Fiscal Year", + "options": "link:Fiscal Year", "fieldname": "fiscal_year", "fieldtype": "Select", "reqd": 1, @@ -239,5 +239,10 @@ "role": "Leave Approver", "cancel": 0, "permlevel": 2 + }, + { + "doctype": "DocPerm", + "role": "All", + "permlevel": 3 } ] \ No newline at end of file