[FIX] web: do not call session load_qweb on frontend
Since commits2a8a17024dand9c68bc7482, 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.
This commit is contained in:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user