|
@@ -38,12 +38,13 @@ class PlanningSlot(models.Model):
|
|
|
datetime_begin, datetime_end = planned_dates_per_calendar_id[slot.resource_id.calendar_id.id]
|
|
datetime_begin, datetime_end = planned_dates_per_calendar_id[slot.resource_id.calendar_id.id]
|
|
|
|
|
|
|
|
start_datetime = slot.start_datetime
|
|
start_datetime = slot.start_datetime
|
|
|
- first_day_of_month = datetime(start_datetime.year, start_datetime.month, 1)
|
|
|
|
|
|
|
+ first_day_of_month = datetime(start_datetime.year, start_datetime.month, 1, 0, 0, 0)
|
|
|
last_day = calendar.monthrange(start_datetime.year, start_datetime.month)[1]
|
|
last_day = calendar.monthrange(start_datetime.year, start_datetime.month)[1]
|
|
|
- last_day_of_month = datetime(start_datetime.year, start_datetime.month, last_day)
|
|
|
|
|
|
|
+ last_day_of_month = datetime(start_datetime.year, start_datetime.month, last_day, 23, 59, 59)
|
|
|
|
|
|
|
|
datetime_begin = min(datetime_begin, first_day_of_month)
|
|
datetime_begin = min(datetime_begin, first_day_of_month)
|
|
|
datetime_end = max(datetime_end, last_day_of_month)
|
|
datetime_end = max(datetime_end, last_day_of_month)
|
|
|
|
|
+
|
|
|
planned_dates_per_calendar_id[slot.resource_id.calendar_id.id] = datetime_begin, datetime_end
|
|
planned_dates_per_calendar_id[slot.resource_id.calendar_id.id] = datetime_begin, datetime_end
|
|
|
for calendar_slot, slot_ids in slots_per_calendar.items():
|
|
for calendar_slot, slot_ids in slots_per_calendar.items():
|
|
|
slots = self.env['planning.slot'].browse(list(slot_ids))
|
|
slots = self.env['planning.slot'].browse(list(slot_ids))
|
|
@@ -55,6 +56,7 @@ class PlanningSlot(models.Model):
|
|
|
datetime_end = timezone_datetime(datetime_end)
|
|
datetime_end = timezone_datetime(datetime_end)
|
|
|
resources = slots.resource_id
|
|
resources = slots.resource_id
|
|
|
day_total = calendar_slot._get_resources_day_total(datetime_begin, datetime_end, resources)
|
|
day_total = calendar_slot._get_resources_day_total(datetime_begin, datetime_end, resources)
|
|
|
|
|
+ _logger.info('DAY TOTAL %s', day_total)
|
|
|
intervals = calendar_slot._work_intervals_batch(datetime_begin, datetime_end, resources)
|
|
intervals = calendar_slot._work_intervals_batch(datetime_begin, datetime_end, resources)
|
|
|
for slot in slots:
|
|
for slot in slots:
|
|
|
slot.real_working_days_count = calendar_slot._get_days_data(
|
|
slot.real_working_days_count = calendar_slot._get_days_data(
|