fix: remove function call from kwarg (#19072)

this commit fixes mail not being sent for leave applications

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
This commit is contained in:
Chinmay Pai 2019-09-16 19:14:42 +05:30 committed by Shivam Mishra
parent bb5f99a34d
commit 7e8e4783a1

View File

@ -439,7 +439,7 @@ def get_leave_details(employee, date):
return ret
@frappe.whitelist()
def get_leave_balance_on(employee, leave_type, date, to_date=nowdate(), consider_all_leaves_in_the_allocation_period=False):
def get_leave_balance_on(employee, leave_type, date, to_date=None, consider_all_leaves_in_the_allocation_period=False):
'''
Returns leave balance till date
:param employee: employee name
@ -449,6 +449,9 @@ def get_leave_balance_on(employee, leave_type, date, to_date=nowdate(), consider
:param consider_all_leaves_in_the_allocation_period: consider all leaves taken till the allocation end date
'''
if not to_date:
to_date = nowdate()
allocation_records = get_leave_allocation_records(employee, date, leave_type)
allocation = allocation_records.get(leave_type, frappe._dict())
@ -753,4 +756,4 @@ def get_leave_approver(employee):
leave_approver = frappe.db.get_value('Department Approver', {'parent': department,
'parentfield': 'leave_approvers', 'idx': 1}, 'approver')
return leave_approver
return leave_approver