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

Module: Advanced Events

Entity: event.track

Compute Method: _compute_field_is_one_day

Inputs Method Outputs
for track in self:
            # Need to localize because it could begin late and finish early in
            # another timezone
            if not (track.date or track.date_end):
                track.is_one_day = False
                continue
            track = track.with_context(tz=track.event_id.date_tz or 'UTC')
            begin_tz = fields.Datetime.context_timestamp(track, track.date)
            end_tz = fields.Datetime.context_timestamp(track, track.date_end)
            track.is_one_day = (begin_tz.date() == end_tz.date())

Back to entity