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

Module: Time Off

Entity: hr.leave

Compute Method: _compute_tz

View 18.0 View 20.0
Inputs Method Outputs
  • resource_calendar_id
  • resource_calendar_id.tz
  • employee_id
  • date_from
for leave in self:
-             leave.tz = leave.resource_calendar_id.tz or self.env.company.resource_calendar_id.tz or self.env.user.tz or 'UTC'
+             tz = self.env.user.tz or 'UTC'
+             if leave.employee_id:
+                 tz = leave.employee_id._get_tz(leave.date_from) or tz
+             leave.tz = tz
  • tz

Back to entity