diff --git a/addons/web/static/src/js/views/list/list_renderer.js b/addons/web/static/src/js/views/list/list_renderer.js index 0d04fd69585..cc1384f03be 100644 --- a/addons/web/static/src/js/views/list/list_renderer.js +++ b/addons/web/static/src/js/views/list/list_renderer.js @@ -248,6 +248,9 @@ var ListRenderer = BasicRenderer.extend({ } if (!reject && c.attrs.widget === 'handle') { self.handleField = c.attrs.name; + if (self.isGrouped) { + return true; + } } return reject; }); diff --git a/addons/web/static/tests/views/list_tests.js b/addons/web/static/tests/views/list_tests.js index 57994cb824f..bbc6cf763cf 100644 --- a/addons/web/static/tests/views/list_tests.js +++ b/addons/web/static/tests/views/list_tests.js @@ -465,6 +465,29 @@ QUnit.module('Views', { list.destroy(); }); + QUnit.test('basic grouped list rendering with widget="handle" col', async function (assert) { + assert.expect(5); + + var list = await createView({ + View: ListView, + model: 'foo', + data: this.data, + arch: '' + + '' + + '' + + '' + + '', + groupBy: ['bar'], + }); + + assert.strictEqual(list.$('th:contains(Foo)').length, 1, "should contain Foo"); + assert.strictEqual(list.$('th:contains(Bar)').length, 1, "should contain Bar"); + assert.containsN(list, 'tr.o_group_header', 2, "should have 2 .o_group_header"); + assert.containsN(list, 'th.o_group_name', 2, "should have 2 .o_group_name"); + assert.containsNone(list, 'th:contains(int_field)', "Should not have int_field in grouped list"); + list.destroy(); + }); + QUnit.test('basic grouped list rendering 1 col without selector', async function (assert) { assert.expect(2);