diff --git a/addons/web/static/src/js/views/graph/graph_view.js b/addons/web/static/src/js/views/graph/graph_view.js index a5ad21e1816..e850b629710 100644 --- a/addons/web/static/src/js/views/graph/graph_view.js +++ b/addons/web/static/src/js/views/graph/graph_view.js @@ -43,6 +43,9 @@ var GraphView = AbstractView.extend({ viewInfo.fields = _.defaults({__count__: {string: _t("Count"), type: "integer"}}, viewInfo.fields); viewInfo.arch.children.forEach(function (field) { var name = field.attrs.name; + if (name === "id") { + return; + } if (field.attrs.interval) { name += ':' + field.attrs.interval; } diff --git a/addons/web/static/tests/views/graph_tests.js b/addons/web/static/tests/views/graph_tests.js index 1e5edef4df3..da9384f72e8 100644 --- a/addons/web/static/tests/views/graph_tests.js +++ b/addons/web/static/tests/views/graph_tests.js @@ -105,6 +105,27 @@ QUnit.module('Views', { graph.destroy(); }); + QUnit.test('field id not in groupBy', function (assert) { + assert.expect(1); + + var graph = createView({ + View: GraphView, + model: "foo", + data: this.data, + arch: '' + + '' + + '', + mockRPC: function (route, args) { + if (args.method === 'read_group') { + assert.deepEqual(args.kwargs.groupby, [], + 'groupby should not contain id field'); + } + return this._super.apply(this, arguments); + } + }); + graph.destroy(); + }); + QUnit.test('switching mode', function (assert) { assert.expect(6);