[FIX] web: Display boolean title in list views
Since commit 9fbb4fb, the `title` attribute is added
to list views `<td>`. The title value is given
by field utils formatting methods, according to the
field type. However, for boolean fields, the formatting
method does not return a string but a jquery element
(unless `forceString: true` is given as an option).
Hence, the displayed title is `[Object object]`.
After this commit, boolean fields do not have any title.
closes odoo/odoo#34657
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit is contained in:
@@ -364,7 +364,8 @@ var ListRenderer = BasicRenderer.extend({
|
||||
isPassword: 'password' in node.attrs,
|
||||
});
|
||||
this._handleAttributes($td, node);
|
||||
return $td.html(formattedValue).attr('title', formattedValue);
|
||||
var title = field.type !== 'boolean' ? formattedValue : '';
|
||||
return $td.html(formattedValue).attr('title', title);
|
||||
},
|
||||
/**
|
||||
* Renders the button element associated to the given node and record.
|
||||
|
||||
@@ -249,6 +249,19 @@ QUnit.module('Views', {
|
||||
list.destroy();
|
||||
});
|
||||
|
||||
QUnit.test('boolean field has no title', async function (assert) {
|
||||
assert.expect(1);
|
||||
|
||||
var list = await createView({
|
||||
View: ListView,
|
||||
model: 'foo',
|
||||
data: this.data,
|
||||
arch: '<tree><field name="bar"/></tree>',
|
||||
});
|
||||
assert.equal(list.$('tbody tr:first td:eq(1)').attr('title'), "");
|
||||
list.destroy();
|
||||
});
|
||||
|
||||
QUnit.test('record-depending invisible lines are correctly aligned', async function (assert) {
|
||||
assert.expect(4);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user