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

Inputs Method Outputs
"""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()

Back to entity