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_request_hour_from_to

Inputs Method Outputs
env_company_calendar = self.env.company.resource_calendar_id
for leave in self:
            calendar = leave.resource_calendar_id or env_company_calendar
            if (
                leave.employee_id
                and leave.request_date_from
                and leave.request_date_to
                and calendar
                and not (
                    leave.request_unit_hours
                    and leave.request_hour_from
                    and leave.request_hour_to
                )
            ):
                hour_from, hour_to = leave._get_hour_from_to(leave.request_date_from, leave.request_date_to)
                leave.request_hour_from = hour_from
                leave.request_hour_to = hour_to

Back to entity