diff --git a/addons/web/static/src/less/list_view.less b/addons/web/static/src/less/list_view.less index 8fad7a04527..0caa775add3 100644 --- a/addons/web/static/src/less/list_view.less +++ b/addons/web/static/src/less/list_view.less @@ -99,6 +99,9 @@ &.o_list_text, &.o_field_text { white-space: pre-wrap; } + &.o_invisible_modifier { + display: initial!important; // Override invisible to keep the cells aligned + } } //-------------------------------------------------------------------------- diff --git a/addons/web/static/tests/views/list_tests.js b/addons/web/static/tests/views/list_tests.js index ece47fc8c87..5b507871734 100644 --- a/addons/web/static/tests/views/list_tests.js +++ b/addons/web/static/tests/views/list_tests.js @@ -164,6 +164,31 @@ QUnit.module('Views', { list.destroy(); }); + QUnit.test('record-depending invisible lines are correctly aligned', function (assert) { + assert.expect(4); + + var list = createView({ + View: ListView, + model: 'foo', + data: this.data, + arch: '' + + '' + + '' + + '' + + '', + }); + + assert.strictEqual(list.$('tbody tr:first td').length, 4, + "there should be 4 cells in the first row"); + assert.strictEqual(list.$('tbody td.o_invisible_modifier').length, 1, + "there should be 1 invisible bar cell"); + assert.ok(list.$('tbody tr:first td:eq(2)').hasClass('o_invisible_modifier'), + "the 3rd cell should be invisible"); + assert.strictEqual(list.$('tbody tr:eq(0) td:visible').length, list.$('tbody tr:eq(1) td:visible').length, + "there should be the same number of visible cells in different rows"); + list.destroy(); + }); + QUnit.test('do not perform extra RPC to read invisible many2one fields', function (assert) { assert.expect(3);