From 8a0e42e8f41f323a605d60aabf008711158e7386 Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Wed, 5 Dec 2018 08:52:28 +0000 Subject: [PATCH] [FIW] website_event_track: fix location order Without this commit, each refresh of the agenda, will randomly show the locs. -- Fix done in prod for oxp closes odoo/odoo#29300 --- addons/website_event_track/controllers/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/website_event_track/controllers/main.py b/addons/website_event_track/controllers/main.py index 036c108a3bd..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