diff options
| author | Mohammed Shekha <msh@odoo.com> | 2020-02-21 10:32:14 +0000 |
|---|---|---|
| committer | Mathieu Duckerts-Antoine <dam@odoo.com> | 2020-05-11 13:40:10 +0000 |
| commit | c28244e4b256c3858ea9fefa3a536907876737fa (patch) | |
| tree | db0998f9d66e72c7959d7661836ef13b33656a5b /addons/web/static/src/js/views | |
| parent | c5886e110924427b88d0212c5483622a0b8fc8c9 (diff) | |
[FIX] web: do not use groupbys in views not groupable
Before this commit: A problem occurs with kanban views that are not
groupable (i.e. for which searchMenuTypes does not contain 'groupBy'):
if the action has a default groupby (set in Studio for instance) then
it is still applied and causes crashes. That happens in the documents
kanban view for instance.
More generally, if a view is not groupable, some information on groupbys
can appear in the interface (in a facet) while not used/useful
for the view.
After this commit:
- if a kanban view is not groupable, a default groupby will never be
applied.
- if a view is not groupable, we ensures that
- the search query generated in the control panel has
groupBy = [],
- groupbys cannot be represented in a facet.
closes odoo/odoo#51041
X-original-commit: 91c80291e90127792623476d8997fd2a67569170
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/views')
| -rw-r--r-- | addons/web/static/src/js/views/kanban/kanban_view.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/kanban/kanban_view.js b/addons/web/static/src/js/views/kanban/kanban_view.js index d49b4a73c4e..1add9169244 100644 --- a/addons/web/static/src/js/views/kanban/kanban_view.js +++ b/addons/web/static/src/js/views/kanban/kanban_view.js @@ -108,7 +108,7 @@ var KanbanView = BasicView.extend({ */ _updateMVCParams: function () { this._super.apply(this, arguments); - if (!this.noDefaultGroupby && this.arch.attrs.default_group_by) { + if (this.searchMenuTypes.includes('groupBy') && !this.noDefaultGroupby && this.arch.attrs.default_group_by) { this.loadParams.groupBy = [this.arch.attrs.default_group_by]; } }, |
