diff options
| author | qsm-odoo <qsm@odoo.com> | 2017-02-02 16:36:43 +0100 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2017-02-03 15:49:23 +0100 |
| commit | a4dc9a80327be61027924372ae558dc71e892e63 (patch) | |
| tree | fd762eabb147f9227c4f93fd7c4634bc5dd47f72 /addons/web/static/src/js/framework | |
| parent | fe32048825ad2f0adb9904c2bdf6e1be123b50f1 (diff) | |
[FIX] web: do not call session load_qweb on frontend
Since commits 2a8a17024d2b46f3f8837a8672334a7dff3abd1b and 9c68bc74827864a3c6c21be8ead1b2ed3d122d73,
the session is not started by the webclient anymore but directly by the
session service instead, and the session info is found in the DOM
instead of by RPC.
Because of that, the session is started in the frontend and other
non-backend environments which caused a JS error while trying to
load qweb (as no qweb has to be loaded). This commit makes the
session start check if it is a non-backend environment and only
initialize session info (from DOM) in that case.
Diffstat (limited to 'addons/web/static/src/js/framework')
| -rw-r--r-- | addons/web/static/src/js/framework/session.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/web/static/src/js/framework/session.js b/addons/web/static/src/js/framework/session.js index 6af97721926..516436af93c 100644 --- a/addons/web/static/src/js/framework/session.js +++ b/addons/web/static/src/js/framework/session.js @@ -86,8 +86,11 @@ var Session = core.Class.extend(mixins.EventDispatcherMixin, { * Init a session, reloads from cookie, if it exists */ session_init: function () { + var def = this.session_reload(); + if (this.is_frontend) return def; + var self = this; - return this.session_reload().then(function() { + return def.then(function() { var modules = self.module_list.join(','); var deferred = self.load_qweb(modules); if(self.session_is_valid()) { |
