mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-09 21:37:38 +00:00
fix: Handle the "no leave_allocation found" case (#23920)
This commit is contained in:
@@ -95,7 +95,11 @@ class LeaveEncashment(Document):
|
||||
create_leave_ledger_entry(self, args, submit)
|
||||
|
||||
# create reverse entry for expired leaves
|
||||
to_date = self.get_leave_allocation().get('to_date')
|
||||
leave_allocation = self.get_leave_allocation()
|
||||
if not leave_allocation:
|
||||
return
|
||||
|
||||
to_date = leave_allocation.get('to_date')
|
||||
if to_date < getdate(nowdate()):
|
||||
args = frappe._dict(
|
||||
leaves=self.encashable_days,
|
||||
|
||||
Reference in New Issue
Block a user