|
@@ -400,10 +400,11 @@ class HrEfficiency(models.Model):
|
|
|
Calculate planned hours from planning module
|
|
Calculate planned hours from planning module
|
|
|
"""
|
|
"""
|
|
|
# Get planning slots for the employee in the date range
|
|
# Get planning slots for the employee in the date range
|
|
|
|
|
+ # Use flexible date range to capture slots that cross month boundaries
|
|
|
planning_slots = self.env['planning.slot'].search([
|
|
planning_slots = self.env['planning.slot'].search([
|
|
|
('employee_id', '=', employee.id),
|
|
('employee_id', '=', employee.id),
|
|
|
- ('start_datetime', '>=', datetime.combine(start_date, datetime.min.time())),
|
|
|
|
|
- ('end_datetime', '<=', datetime.combine(end_date, datetime.max.time())),
|
|
|
|
|
|
|
+ ('start_datetime', '<', datetime.combine(end_date + relativedelta(days=1), datetime.min.time())),
|
|
|
|
|
+ ('end_datetime', '>', datetime.combine(start_date - relativedelta(days=1), datetime.max.time())),
|
|
|
# Removed state restriction to include all planning slots regardless of state
|
|
# Removed state restriction to include all planning slots regardless of state
|
|
|
])
|
|
])
|
|
|
|
|
|