19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:32:34 +01:00
parent 5faf7397c5
commit 2696f14ed7
721 changed files with 220375 additions and 91221 deletions

View file

@ -0,0 +1,11 @@
from odoo.tools.intervals import Intervals
def interval_from_events(event_ids):
"""Group events with contiguous and/or overlapping time slots.
Can be used to avoid doing time-related querries on long stretches of time with no relevant event.
:param <calendar.event> event_ids: Any recordset of events
:return Intervals|Iterable[tuple[datetime, datetime, <calendar.event>]]:
"""
return Intervals([(event.start, event.stop, event) for event in event_ids if event.start and event.stop])