[FIX] web: List: display invisible cells

An invisible cell should be visible in the list renderer otherwise
the cells are not correctly aligned anymore.
This commit is contained in:
Martin Geubelle
2017-05-05 17:05:53 +02:00
parent 580e78ad37
commit 4d6aff97b6
2 changed files with 28 additions and 0 deletions
@@ -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
}
}
//--------------------------------------------------------------------------
@@ -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);