From 4fe2a91b9fe0a8a7afc21e68502adc5ff8e9ee78 Mon Sep 17 00:00:00 2001 From: Shreya Shah Date: Wed, 13 Jun 2018 15:11:43 +0530 Subject: [PATCH] Remove docstatus=1 to show pending leaves as well (#14498) --- erpnext/hr/doctype/leave_application/leave_application.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py index b3f2068e8d..747782931e 100755 --- a/erpnext/hr/doctype/leave_application/leave_application.py +++ b/erpnext/hr/doctype/leave_application/leave_application.py @@ -406,7 +406,7 @@ def get_leaves_for_period(employee, leave_type, from_date, to_date, status): select employee, leave_type, from_date, to_date, total_leave_days from `tabLeave Application` where employee=%(employee)s and leave_type=%(leave_type)s - and status = %(status)s and docstatus=1 + and status = %(status)s and (from_date between %(from_date)s and %(to_date)s or to_date between %(from_date)s and %(to_date)s or (from_date < %(from_date)s and to_date > %(to_date)s))