From e0297244032130531afc6b2eb029895c67f5beda Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Wed, 9 Dec 2015 16:10:53 +0100 Subject: [PATCH] [FIX] web_calendar: safer evaluation of color filters In some loading cases, the all_filters may not be loaded yet so fail at the evaluation. Making it safer and check the content. opw 659052 --- addons/web_calendar/static/src/js/web_calendar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_calendar/static/src/js/web_calendar.js b/addons/web_calendar/static/src/js/web_calendar.js index 4c4cc67afa5..f522e9e3164 100644 --- a/addons/web_calendar/static/src/js/web_calendar.js +++ b/addons/web_calendar/static/src/js/web_calendar.js @@ -630,7 +630,7 @@ var CalendarView = View.extend({ r.className = 'o_calendar_color_'+ this.get_color(color_key); } } else { // if form all, get color -1 - r.className = 'o_calendar_color_'+ self.all_filters[-1].color; + r.className = 'o_calendar_color_'+ self.all_filters[-1] ? self.all_filters[-1].color : 1; } return r; },