diff options
| author | Pierre Paridans <app@odoo.com> | 2019-07-12 09:52:12 +0000 |
|---|---|---|
| committer | Pierre Paridans <app@odoo.com> | 2019-07-18 09:17:52 +0000 |
| commit | 1bfdf9219d634f75e44b2b2440e14958080cd981 (patch) | |
| tree | ae75878cebc188d9d7216850d6faa2b7e1315bd7 | |
| parent | a42ea0195d956b7d71359804e105faf94b74e696 (diff) | |
[IMP] web: unused on_modules_loaded hook
`window.openerp` being undefined, the method `on_modules_loaded` throws
an error when reaching its purpose (loading additional modules)...
The commit odoo/odoo@905e01921f3c3ef43ace6fc537d1d8c0d280002c 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/odoo#34821
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
| -rw-r--r-- | addons/web/static/src/js/core/session.js | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/addons/web/static/src/js/core/session.js b/addons/web/static/src/js/core/session.js index dac8e0077f1..09d765fbc5b 100644 --- a/addons/web/static/src/js/core/session.js +++ b/addons/web/static/src/js/core/session.js @@ -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(); }, @@ -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); @@ -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]; }, |
