summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/core
diff options
context:
space:
mode:
authorChristophe Matthieu <chm@odoo.com>2018-02-06 11:17:06 +0100
committerChristophe Matthieu <chm@odoo.com>2018-02-08 15:45:30 +0100
commit4f5fc6ee552e5f2edca6401d04761a3c19797dc7 (patch)
tree849e0deef856f5b72ad30ba12126ae056c97cfac /addons/web/static/src/js/core
parent83795d37f3b512797dd78de027e444f305ab9ef1 (diff)
[FIX] web: properly set parent when using mixins
The parentedMixin doesn't automatically set the parent, so when this mixin is used, the parent must be set manually. This wasn't done at several places, and thus those elements weren't destroyed with their actual parent. In master, we should probably make the ParentedMixin set the parent itself.
Diffstat (limited to 'addons/web/static/src/js/core')
-rw-r--r--addons/web/static/src/js/core/bus.js5
-rw-r--r--addons/web/static/src/js/core/session.js3
2 files changed, 5 insertions, 3 deletions
diff --git a/addons/web/static/src/js/core/bus.js b/addons/web/static/src/js/core/bus.js
index bf33c1fe01e..e2b76594946 100644
--- a/addons/web/static/src/js/core/bus.js
+++ b/addons/web/static/src/js/core/bus.js
@@ -8,8 +8,9 @@ var mixins = require('web.mixins');
* Event Bus used to bind events scoped in the current instance
*/
return Class.extend(mixins.EventDispatcherMixin, {
- init: function() {
- mixins.EventDispatcherMixin.init.call(this, parent);
+ init: function (parent) {
+ mixins.EventDispatcherMixin.init.call(this);
+ this.setParent(parent);
},
});
diff --git a/addons/web/static/src/js/core/session.js b/addons/web/static/src/js/core/session.js
index 670e367be2e..ee9427827ba 100644
--- a/addons/web/static/src/js/core/session.js
+++ b/addons/web/static/src/js/core/session.js
@@ -28,7 +28,8 @@ var Session = core.Class.extend(mixins.EventDispatcherMixin, {
"override_session" is set to true.
*/
init: function (parent, origin, options) {
- mixins.EventDispatcherMixin.init.call(this, parent);
+ mixins.EventDispatcherMixin.init.call(this);
+ this.setParent(parent);
options = options || {};
this.module_list = (options.modules && options.modules.slice()) || (window.odoo._modules && window.odoo._modules.slice()) || [];
this.server = null;