summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2018-09-11 20:48:38 +0200
committerAaron Bohy <aab@odoo.com>2018-09-12 13:30:24 +0200
commit18bd4fa7499e426f51e3dd80f1d91fa0f3da0111 (patch)
tree1ce8433dee908b25a27f1f5bb3de0c16fcc078a0 /addons/web/static/src/js
parent0abae675e8edd3f5da5566b31620431e0989118c (diff)
[FIX] web: remove race condition at webclient startup
Before this rev., there was a race condition making some tours randomly fail on runbot, when the following steps occurred in that order: - load webclient - as soon as the menu is ready and visible, click on a root menu which thus leads to a doAction - in the meantime, an RPC is done by the webclient to retrieve the (optional) default action of the user (if there is no state in the url, which is the case for tours in general) - when that RPC returns, this action (if any), or the action of the first menu is executed, thus leading to a second doAction - the ActionManager using a DropPrevious, the first doAction is dropped and thus the action linked to the clicked menu is never shown, making the tour fail This rev. uses the state of the ActionManager's DropPrevious to prevent the default action from being executed if another action is already being executed, thus removing that race condition. Note that this fix is temporary, as the community webclient is currently being refactored.
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/chrome/web_client.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/web/static/src/js/chrome/web_client.js b/addons/web/static/src/js/chrome/web_client.js
index 622d9d681ec..ca777d470ae 100644
--- a/addons/web/static/src/js/chrome/web_client.js
+++ b/addons/web/static/src/js/chrome/web_client.js
@@ -107,7 +107,8 @@ return AbstractWebClient.extend({
args: [[session.uid], ['action_id']],
})
.done(function(result) {
- if (didHashChanged) {
+ var amDef = self.action_manager.dp.current_def;
+ if (didHashChanged || (amDef && amDef.state() === 'pending')) {
return;
}
var data = result[0];