diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py index b73d0e5b3fb..560dd1d3bfd 100755 --- a/erpnext/hr/doctype/leave_application/leave_application.py +++ b/erpnext/hr/doctype/leave_application/leave_application.py @@ -512,7 +512,7 @@ def add_department_leaves(events, start, end, employee, company): department_employees = frappe.db.sql_list("""select name from tabEmployee where department=%s and company=%s""", (department, company)) - filter_conditions = "employee in (\"%s\")" % '", "'.join(department_employees) + filter_conditions = " and employee in (\"%s\")" % '", "'.join(department_employees) add_leaves(events, start, end, filter_conditions=filter_conditions) def add_leaves(events, start, end, filter_conditions=None):