[FIX] web: List: handle custom class on button

It should be possible to set a custom class on a button in the list view.

Closes #20620
This commit is contained in:
Martin Geubelle
2017-11-27 14:01:50 +01:00
parent 2fbbf0b1ff
commit 76ba56e60d
2 changed files with 4 additions and 3 deletions
@@ -307,7 +307,7 @@ var ListRenderer = BasicRenderer.extend({
} else {
$button.text(node.attrs.string);
}
this._handleAttributes($button, node);
this._registerModifiers(node, record, $button);
if (record.res_id) {
+3 -2
View File
@@ -1088,7 +1088,7 @@ QUnit.module('Views', {
});
QUnit.test('can display button in edit mode', function (assert) {
assert.expect(1);
assert.expect(2);
var list = createView({
View: ListView,
@@ -1096,10 +1096,11 @@ QUnit.module('Views', {
data: this.data,
arch: '<tree editable="bottom">' +
'<field name="foo"/>' +
'<button name="notafield" type="object" icon="fa-asterisk"/>' +
'<button name="notafield" type="object" icon="fa-asterisk" class="o_yeah"/>' +
'</tree>',
});
assert.ok(list.$('tbody button').length, "should have a button");
assert.ok(list.$('tbody button').hasClass('o_yeah'), "class should be set on the button");
list.destroy();
});