summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorMartin Geubelle <mge@odoo.com>2017-05-05 14:56:21 +0200
committerMartin Geubelle <mge@odoo.com>2017-05-05 17:05:53 +0200
commit4d6aff97b6ada270593e5cd45393b455cfa8455d (patch)
treeee6bb23552e19d2f9c97ebc670bb63cefa9e13b4 /addons
parent580e78ad375aa3f52f2307c82281268796275aea (diff)
[FIX] web: List: display invisible cells
An invisible cell should be visible in the list renderer otherwise the cells are not correctly aligned anymore.
Diffstat (limited to 'addons')
-rw-r--r--addons/web/static/src/less/list_view.less3
-rw-r--r--addons/web/static/tests/views/list_tests.js25
2 files changed, 28 insertions, 0 deletions
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: '<tree>' +
+ '<field name="foo"/>' +
+ '<field name="bar" attrs="{\'invisible\': [(\'id\',\'=\', 1)]}"/>' +
+ '<field name="int_field"/>' +
+ '</tree>',
+ });
+
+ 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);