Skip to content

Commit

Permalink
[IMP] web: unused on_modules_loaded hook
Browse files Browse the repository at this point in the history
`window.openerp` being undefined, the method `on_modules_loaded` throws
an error when reaching its purpose (loading additional modules)...

The commit odoo/odoo@905e019 removed
the compatibility layer for Odoo v8 (compatibility.js) which contained
the `window.openerp` declaration.

Being broken for that long without consequences, this feature proved to
not be useful anymore. We then remove it.

closes odoo#34821

Signed-off-by: Aaron Bohy (aab) <[email protected]>
  • Loading branch information
pparidans committed Jul 18, 2019
1 parent a42ea01 commit 1bfdf92
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions addons/web/static/src/js/core/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,12 @@ var Session = core.Class.extend(mixins.EventDispatcherMixin, {
* Setup a session
*/
session_bind: function (origin) {
var self = this;
this.setup(origin);
qweb.default_dict._s = this.origin;
this.uid = null;
this.username = null;
this.user_context= {};
this.db = null;
this.module_loaded = {};
_(this.module_list).each(function (mod) {
self.module_loaded[mod] = true;
});
this.active_id = null;
return this.session_init();
},
Expand Down Expand Up @@ -212,10 +207,7 @@ var Session = core.Class.extend(mixins.EventDispatcherMixin, {
}
return loaded.then(function () {
return self.load_js(file_list);
}).then(function () {
self.on_modules_loaded();
self.trigger('module_loaded');
});
});
},
load_translations: function () {
return _t.database.load_translations(this, this.module_list, this.user_context.lang, this.translationURL);
Expand Down Expand Up @@ -250,25 +242,6 @@ var Session = core.Class.extend(mixins.EventDispatcherMixin, {
});
return lock;
},
on_modules_loaded: function () {
var openerp = window.openerp;
for(var j=0; j<this.module_list.length; j++) {
var mod = this.module_list[j];
if(this.module_loaded[mod])
continue;
openerp[mod] = {};
// init module mod
var fct = openerp._openerp[mod];
if(typeof(fct) === "function") {
openerp._openerp[mod] = {};
for (var k in fct) {
openerp._openerp[mod][k] = fct[k];
}
fct(openerp, openerp._openerp[mod]);
}
this.module_loaded[mod] = true;
}
},
get_currency: function (currency_id) {
return this.currencies[currency_id];
},
Expand Down

0 comments on commit 1bfdf92

Please sign in to comment.