Skip to content

Commit

Permalink
perf: limit rows to 1 for cf leave expiry query
Browse files Browse the repository at this point in the history
(cherry picked from commit 837bfac)
  • Loading branch information
ruchamahabal authored and mergify[bot] committed Nov 17, 2023
1 parent e008dad commit 1db1fc5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hrms/hr/doctype/leave_application/leave_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,7 @@ def get_allocation_expiry_for_cf_leaves(
"docstatus": 1,
},
fields=["to_date"],
limit=1,
)
return expiry[0]["to_date"] if expiry else ""

Expand Down Expand Up @@ -1031,7 +1032,7 @@ def get_leaves_for_period(
if leave_entry.leaves % 1:
half_day = 1
half_day_date = frappe.db.get_value(
"Leave Application", {"name": leave_entry.transaction_name}, ["half_day_date"]
"Leave Application", {"name": leave_entry.transaction_name}, "half_day_date"
)

leave_days += (
Expand Down

0 comments on commit 1db1fc5

Please sign in to comment.