mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-24 13:42:10 +01:00
fix: exclude carry forwarding leaves while updating leaves after submission
This commit is contained in:
@@ -99,7 +99,11 @@ class LeaveAllocation(Document):
|
|||||||
# run required validations again since total leaves are being updated
|
# run required validations again since total leaves are being updated
|
||||||
self.validate_leave_days_and_dates()
|
self.validate_leave_days_and_dates()
|
||||||
|
|
||||||
leaves_to_be_added = self.new_leaves_allocated - self.get_existing_leave_count()
|
leaves_to_be_added = (
|
||||||
|
frappe.db.get_value("Leave Allocation", self.name, "new_leaves_allocated")
|
||||||
|
- self.get_existing_leave_count()
|
||||||
|
)
|
||||||
|
|
||||||
args = {
|
args = {
|
||||||
"leaves": leaves_to_be_added,
|
"leaves": leaves_to_be_added,
|
||||||
"from_date": self.from_date,
|
"from_date": self.from_date,
|
||||||
@@ -118,6 +122,7 @@ class LeaveAllocation(Document):
|
|||||||
"employee": self.employee,
|
"employee": self.employee,
|
||||||
"company": self.company,
|
"company": self.company,
|
||||||
"leave_type": self.leave_type,
|
"leave_type": self.leave_type,
|
||||||
|
"is_carry_forward": 0,
|
||||||
},
|
},
|
||||||
pluck="leaves",
|
pluck="leaves",
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user