summaryrefslogtreecommitdiff
path: root/addons/web/static
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2018-04-25 09:22:36 +0200
committerAaron Bohy <aab@odoo.com>2018-04-25 15:08:53 +0200
commitf85a54257d7bac46d3df7daba60a4242381a3107 (patch)
tree8697e6d14c8c0781626afb595eee976c6b0e8e43 /addons/web/static
parent1ce5bea306e01285b610a30345013434823de578 (diff)
[FIX] web: BasicRenderer: button's name attr in DOM
Rev. 374af56 changed the way 'button' nodes are rendered in basic views (form, list, kanban). As a consequence, their 'name' attribute wasn't transmitted to the produced html elements anymore. However, this attribute is very convenient to debug views, and to write selectors in tests. For instance, it broke the test added by rev. 8d17a2a once forwardported in master. This commit reverts 1ce5bea.
Diffstat (limited to 'addons/web/static')
-rw-r--r--addons/web/static/src/js/views/basic/basic_renderer.js2
-rw-r--r--addons/web/static/tests/views/form_tests.js4
2 files changed, 4 insertions, 2 deletions
diff --git a/addons/web/static/src/js/views/basic/basic_renderer.js b/addons/web/static/src/js/views/basic/basic_renderer.js
index c05d467052e..16507184915 100644
--- a/addons/web/static/src/js/views/basic/basic_renderer.js
+++ b/addons/web/static/src/js/views/basic/basic_renderer.js
@@ -529,7 +529,7 @@ var BasicRenderer = AbstractRenderer.extend({
*/
_renderButtonFromNode: function (node, options) {
var btnOptions = {
- attrs: _.omit(node.attrs, 'icon', 'string', 'type', 'name', 'attrs', 'modifiers', 'options'),
+ attrs: _.omit(node.attrs, 'icon', 'string', 'type', 'attrs', 'modifiers', 'options'),
icon: node.attrs.icon,
};
if (options && options.extraClass) {
diff --git a/addons/web/static/tests/views/form_tests.js b/addons/web/static/tests/views/form_tests.js
index 4468897010f..760586cc6fb 100644
--- a/addons/web/static/tests/views/form_tests.js
+++ b/addons/web/static/tests/views/form_tests.js
@@ -987,7 +987,7 @@ QUnit.module('Views', {
});
QUnit.test('buttons in form view', function (assert) {
- assert.expect(7);
+ assert.expect(8);
var rpcCount = 0;
@@ -1018,6 +1018,8 @@ QUnit.module('Views', {
assert.strictEqual(form.$('.o_form_statusbar button').length, 2,
"should have 2 buttons in the statusbar");
+ assert.strictEqual(form.$('button[name="post"]').length, 1,
+ "'name' attribute of buttons is transmitted to the rendered html element");
assert.strictEqual(form.$('.o_form_statusbar button:visible').length, 1,
"should have only 1 visible button in the statusbar");