[FIX] web_calendar: prevent crash when the color field is undefined
Add a check for the presence of color field. (only applies when "useContacts" is not set) Before this fix, if the view xml does not set "useContacts", the calendar view fallback on the color attribute (not required) which may be non-existent on the model and on the view. web_calendar.js:799 is using "if (color_field.type == "selection")" so its throwing this error when color is not defined: Uncaught TypeError: Cannot read property 'type' of undefined
This commit is contained in:
committed by
Christophe Matthieu
parent
9e870d9a0a
commit
20facf5cf9
@@ -788,7 +788,7 @@ var CalendarView = View.extend({
|
||||
return;
|
||||
}
|
||||
|
||||
if (!self.useContacts) { // If we use all peoples displayed in the current month as filter in sidebars
|
||||
if (!self.useContacts && self.fields[self.color_field]) { // If we use all peoples displayed in the current month as filter in sidebars
|
||||
var filter_item;
|
||||
|
||||
self.now_filter_ids = [];
|
||||
|
||||
Reference in New Issue
Block a user