diff --git a/hrms/hr/doctype/leave_encashment/leave_encashment.py b/hrms/hr/doctype/leave_encashment/leave_encashment.py index b32f9ebd67..66481f6bea 100644 --- a/hrms/hr/doctype/leave_encashment/leave_encashment.py +++ b/hrms/hr/doctype/leave_encashment/leave_encashment.py @@ -204,7 +204,9 @@ def create_leave_ledger_entry(self, submit=True): return to_date = leave_allocation.get("to_date") - if to_date < getdate(): + + can_expire = not frappe.db.get_value("Leave Type", self.leave_type, "is_carry_forward") + if to_date < getdate() and can_expire: args = frappe._dict( leaves=self.encashment_days, from_date=to_date, to_date=to_date, is_carry_forward=0 )