fix(hr): update leave application status on cancel (#19883)

This commit is contained in:
Parth J. Kharwar 2019-12-23 18:41:17 +05:30 committed by Nabin Hait
parent d8c10bcedb
commit da5d5c4941

View File

@ -54,9 +54,11 @@ class LeaveApplication(Document):
self.create_leave_ledger_entry()
self.reload()
def before_cancel(self):
self.status = "Cancelled"
def on_cancel(self):
self.create_leave_ledger_entry(submit=False)
self.status = "Cancelled"
# notify leave applier about cancellation
self.notify_employee()
self.cancel_attendance()