Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.
Module: Resource
Entity: resource.calendar.leaves
Compute Method: _compute_date_to
| Inputs | Method | Outputs |
|---|---|---|
|
- user_tz = timezone(self.env.user.tz or self._context.get('tz') or self.company_id.resource_calendar_id.tz or 'UTC') + user_tz = self.env.tz + if not (self.env.user.tz or self.env.context.get('tz')): + user_tz = ZoneInfo(self.company_id.tz or 'UTC') for leave in self: if not leave.date_from or (leave.date_to and leave.date_to > leave.date_from): continue - local_date_from = utc.localize(leave.date_from).astimezone(user_tz) + local_date_from = leave.date_from.replace(tzinfo=UTC).astimezone(user_tz) local_date_to = local_date_from + relativedelta(hour=23, minute=59, second=59) - leave.date_to = local_date_to.astimezone(utc).replace(tzinfo=None) + leave.date_to = local_date_to.astimezone(UTC).replace(tzinfo=None) |
|
