Skip to content
Snippets Groups Projects
Commit b9ac7090 authored by Nicolas Lempereur's avatar Nicolas Lempereur
Browse files

[FIX] web_kanban: double click double action

When multiple clicking fast (and with the server not too fast), we could
end up with an error (eg. "Cannot read property 'controller' of null").

Something has been done previously to improve this when switching
between views in: fc8a4b5e. This commit do something similar to limit
multiple click on kanban records (doing it as in 26f91c42).

note: master equivalent of 8f1cc2fa (which is for 10.0 up to saas-15)

opw-705329
closes #16775
parent 5d641211
No related branches found
No related tags found
No related merge requests found
......@@ -39,6 +39,8 @@ var KanbanRecord = Widget.extend({
this.subWidgets = {};
this._setState(state);
// avoid quick multiple clicks
this._onKanbanActionClicked = _.debounce(this._onKanbanActionClicked, 300, true);
},
start: function () {
return this._super.apply(this, arguments).then(this._render.bind(this));
......
......@@ -945,7 +945,7 @@ QUnit.module('Views', {
});
QUnit.test('button executes action and reloads', function (assert) {
assert.expect(5);
assert.expect(6);
var kanban = createView({
View: KanbanView,
......@@ -975,6 +975,9 @@ QUnit.module('Views', {
$('button[data-name="a1"]').first().click();
assert.strictEqual(count, 1, "should have triggered a execute action");
$('button[data-name="a1"]').first().click();
assert.strictEqual(count, 1, "double-click on kanban actions should be debounced");
assert.verifySteps([
'/web/dataset/search_read',
'/web/dataset/call_kw/partner/read'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment