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

Module: HR Timesheet Time Control begin/end

Entity: account.analytic.line

Compute Method: _compute_time_begin

Inputs Method Outputs
  • date_time
  • employee_id
  • employee_id.tz
for record in self:
            if record.date_time:
                tz = (
                    pytz.timezone(record.employee_id.tz)
                    if record.employee_id.tz
                    else pytz.timezone(self.env.user.tz)
                )
                date = record.date_time.astimezone(tz)
                record.time_begin = date.hour + (date.minute / 60.0)
            else:
                record.time_begin = False

Back to entity