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

Module: Event Sessions

Entity: event.session

Compute Method: _compute_is_one_day

View 18.0
Inputs Method Outputs
  • date_begin
  • date_end
- """Similar to core's :meth:`event_event._compute_field_is_one_day`"""
- for rec in self:
-             # Need to localize because it could begin late and finish early in
-             # another timezone
-             rec = rec._set_tz_context()
-             begin_tz = fields.Datetime.context_timestamp(rec, rec.date_begin)
-             end_tz = fields.Datetime.context_timestamp(rec, rec.date_end)
-             rec.is_one_day = begin_tz.date() == end_tz.date()
  • is_one_day

Back to entity