From 8af3d452f414135bd897026859958a9660bb5aa4 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Thu, 18 May 2017 13:16:48 +0200 Subject: [FIX] web: BasicModel: read_group on selection field When grouping on a selection field, the read_group may return a group for value false (containing records with the selection field unset, typically). When this happened, there was a crash because the BasicModel didn't handle that case (it assumed that the value of the groups was always a valid key of the selection). --- addons/web/static/src/js/views/basic/basic_model.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src/js/views/basic/basic_model.js') diff --git a/addons/web/static/src/js/views/basic/basic_model.js b/addons/web/static/src/js/views/basic/basic_model.js index eef42f19bc3..37adddfcd75 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -2576,7 +2576,7 @@ var BasicModel = AbstractModel.extend({ var choice = _.find(list.fields[rawGroupBy].selection, function (c) { return c[0] === value; }); - value = choice[1]; + value = choice ? choice[1] : false; } var newGroup = self._makeDataPoint({ modelName: list.model, -- cgit v1.2.3