Browse Source

[FIX] Bad hour for shift generated the day of timeshift, use the hour of the shift instead of 00:00:00 to call context_timestamp

pull/105/head
Thibault Francois 6 years ago
committed by Elouan
parent
commit
9488fd0420
  1. 1
      beesdoo_shift/models/planning.py

1
beesdoo_shift/models/planning.py

@ -103,6 +103,7 @@ class TaskTemplate(models.Model):
day = today + timedelta(days=rec.day_nb_id.number - 1) day = today + timedelta(days=rec.day_nb_id.number - 1)
h_begin, m_begin = floatime_to_hour_minute(rec.start_time) h_begin, m_begin = floatime_to_hour_minute(rec.start_time)
h_end, m_end = floatime_to_hour_minute(rec.end_time) h_end, m_end = floatime_to_hour_minute(rec.end_time)
day = day.replace(hour=h_begin, minute=m_begin)
rec.start_date = fields.Datetime.context_timestamp(self, day).replace(hour=h_begin, minute=m_begin, second=0).astimezone(UTC) rec.start_date = fields.Datetime.context_timestamp(self, day).replace(hour=h_begin, minute=m_begin, second=0).astimezone(UTC)
rec.end_date = fields.Datetime.context_timestamp(self, day).replace(hour=h_end, minute=m_end, second=0).astimezone(UTC) rec.end_date = fields.Datetime.context_timestamp(self, day).replace(hour=h_end, minute=m_end, second=0).astimezone(UTC)

Loading…
Cancel
Save