fix: commit leave_allocation change to db (#25382) (#25383)

This commit is contained in:
Ankush Menat 2021-04-19 12:47:41 +05:30 committed by GitHub
parent b6d2106184
commit edf3dfa5a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,7 +66,7 @@ class CompensatoryLeaveRequest(Document):
else: else:
leave_allocation = self.create_leave_allocation(leave_period, date_difference) leave_allocation = self.create_leave_allocation(leave_period, date_difference)
self.leave_allocation=leave_allocation.name self.db_set("leave_allocation", leave_allocation.name)
else: else:
frappe.throw(_("There is no leave period in between {0} and {1}").format(format_date(self.work_from_date), format_date(self.work_end_date))) frappe.throw(_("There is no leave period in between {0} and {1}").format(format_date(self.work_from_date), format_date(self.work_end_date)))
@ -124,4 +124,4 @@ class CompensatoryLeaveRequest(Document):
)) ))
allocation.insert(ignore_permissions=True) allocation.insert(ignore_permissions=True)
allocation.submit() allocation.submit()
return allocation return allocation