Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Employees Shifts

Entity: hr.shift.planning.line

Compute Method: _compute_start_date

View 17.0
Inputs Method Outputs
  • template_id
  • template_id.tz
  • start_time
- for shift in self:
-             local_tz = pytz.timezone(shift.template_id.tz or self.env.user.tz)
-             shift.start_date = (
-                 pytz.utc.localize(shift.start_time)
-                 .astimezone(local_tz)
-                 .replace(tzinfo=None)
-             )
  • start_date

Back to entity