[FIX]hr_employee_stats_sheet:remove invalid or inactive recoveries from total_recovery_hours in timesheet_sheet statistics
This commit is contained in:
@@ -109,6 +109,7 @@ class HrEmployeeStats(models.Model):
|
||||
return total_planned_hours
|
||||
|
||||
def _get_total_recovery_hours(self):
|
||||
#TODO: duplicated code with _get_total_leave_hours, to refactor later
|
||||
self.ensure_one()
|
||||
recovery = self.env["hr.leave"]
|
||||
total_recovery_hours = 0
|
||||
@@ -119,6 +120,8 @@ class HrEmployeeStats(models.Model):
|
||||
("holiday_status_id", "=", self._get_holiday_status_id()),
|
||||
("request_date_from", "<=", self.date),
|
||||
("request_date_to", ">=", self.date),
|
||||
("state", '=', 'validate'),
|
||||
("active", '=', True),
|
||||
],
|
||||
)
|
||||
for recovery_id in recovery_ids:
|
||||
|
||||
Reference in New Issue
Block a user