summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/chrome/abstract_web_client.js
diff options
context:
space:
mode:
authorAdrien Dieudonne <adr@odoo.com>2018-06-13 15:21:24 +0200
committerAdrien Dieudonne <adr@odoo.com>2018-06-14 15:57:55 +0200
commit1aacc962620982528a3dfc90d2c1dd0027359375 (patch)
tree817a044c8cb89c7529a7e79e1a400f8effee5c36 /addons/web/static/src/js/chrome/abstract_web_client.js
parent45f28766946add04bbaa3336292c56273e7a8bf8 (diff)
[FIX] web: checks rpc responses in web.ajax
Before this commit, load_action and load_views were never resolved in case of internet connection loss. It's because the call is triggered by web.rpc direcly who uses ajax.rpc without any response check. Now the rpc response is checked in web.ajax. Thereby all responses are handled whether they come from session.rpc or rpc.query. Plus, it was not the responsibility of the session to check the rpc responses. Steps to reproduce the issue: (1) load_action: - Go to the app switcher for the first time - Force disconnected from the network -> No notification appears and the user aren't notify (2) load_views (mobile only): - Go to Sales -> Quotation (In this case, the first call is 'load_views' because we need to force to load some views like kanban view) - Force disconnected from the network -> No notification appears and the user aren't notify Note: It's now important to notify the user about connection loss because a recent improvement in mobile app replaces the 'retry screen' and lets the webclient handle connection issues by itself. The single odoo mobile app is supposed to work with all databases from 10.0.
Diffstat (limited to 'addons/web/static/src/js/chrome/abstract_web_client.js')
-rw-r--r--addons/web/static/src/js/chrome/abstract_web_client.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web/static/src/js/chrome/abstract_web_client.js b/addons/web/static/src/js/chrome/abstract_web_client.js
index febfecad0bc..939f73bd315 100644
--- a/addons/web/static/src/js/chrome/abstract_web_client.js
+++ b/addons/web/static/src/js/chrome/abstract_web_client.js
@@ -165,7 +165,7 @@ var AbstractWebClient = Widget.extend(mixins.ServiceProvider, {
core.bus.on('connection_restored', this, this.on_connection_restored);
// crash manager integration
- session.on('error', crash_manager, crash_manager.rpc_error);
+ core.bus.on('rpc_error', crash_manager, crash_manager.rpc_error);
window.onerror = function (message, file, line, col, error) {
// Scripts injected in DOM (eg: google API's js files) won't return a clean error on window.onerror.
// The browser will just give you a 'Script error.' as message and nothing else for security issue.