diff options
Diffstat (limited to 'addons/website_event_track/controllers/main.py')
| -rw-r--r-- | addons/website_event_track/controllers/main.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/website_event_track/controllers/main.py b/addons/website_event_track/controllers/main.py index 48447342976..ce7fa9fbf94 100644 --- a/addons/website_event_track/controllers/main.py +++ b/addons/website_event_track/controllers/main.py @@ -64,6 +64,7 @@ class WebsiteEventTrackController(http.Controller): locations[location][-1][3] -= 1 locations[location].append([track, start_date, end_date, 1]) dates[-1][1][location] = locations[location][-1] + locations = collections.OrderedDict(sorted(locations.items(), key=lambda t: t[0].id if t[0] else 0)) return { 'locations': locations, 'dates': dates @@ -77,7 +78,7 @@ class WebsiteEventTrackController(http.Controller): event = event.with_context(tz=event.date_tz or 'UTC') local_tz = pytz.timezone(event.date_tz or 'UTC') days_tracks = collections.defaultdict(lambda: []) - for track in event.track_ids.sorted(lambda track: (track.date or '', bool(track.location_id))): + for track in event.track_ids.sorted(lambda track: (bool(track.date), track.date, bool(track.location_id))): if not track.date: continue date = fields.Datetime.from_string(track.date).replace(tzinfo=pytz.utc).astimezone(local_tz) |
