diff options
| author | David Monjoie <dmo@odoo.com> | 2017-08-09 11:22:56 +0200 |
|---|---|---|
| committer | David Monjoie <dmo@odoo.com> | 2017-08-10 08:48:30 +0200 |
| commit | 50957038b9ebe5e249da28a9745f957ad02a0760 (patch) | |
| tree | 29835411cc9b02de2eb76a0015f4b2075aa9e6eb /addons/web/static/src/js/views/basic/basic_model.js | |
| parent | 0de067cae919937cfc5fa4cd3161d58f48d472b5 (diff) | |
[FIX] web: fix magic grouping on date fields
Date fields have magic grouping methods to specify how to group on
them like date:month, date:weeks, date:days for example. It needs
to be handled properly since date:month is not a valid field name
but date is.
Steps to reproduce the issue:
- Go to Sales/Dashboard
- Click on My Pipeline
- Group by "Creation Month"
Basically, this can be triggred from any view which has a search
view which defines a group using the magic date grouping methods.
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_model.js')
| -rw-r--r-- | addons/web/static/src/js/views/basic/basic_model.js | 6 |
1 files changed, 3 insertions, 3 deletions
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 acb0dddbcb6..288186e4d5a 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -3096,7 +3096,9 @@ var BasicModel = AbstractModel.extend({ */ _readGroup: function (list) { var self = this; - var fields = _.uniq(list.getFieldNames().concat(list.groupedBy)); + var groupByField = list.groupedBy[0]; + var rawGroupBy = groupByField.split(':')[0]; + var fields = _.uniq(list.getFieldNames().concat(rawGroupBy)); return this._rpc({ model: list.model, method: 'read_group', @@ -3107,8 +3109,6 @@ var BasicModel = AbstractModel.extend({ lazy: true, }) .then(function (groups) { - var groupByField = list.groupedBy[0]; - var rawGroupBy = groupByField.split(':')[0]; var previousGroups = _.map(list.data, function (groupID) { return self.localData[groupID]; }); |
