diff --git a/addons/web/static/src/legacy/js/owl_compatibility.js b/addons/web/static/src/legacy/js/owl_compatibility.js index e1c82cd3468..9afa2b49685 100644 --- a/addons/web/static/src/legacy/js/owl_compatibility.js +++ b/addons/web/static/src/legacy/js/owl_compatibility.js @@ -343,6 +343,7 @@ odoo.define('web.OwlCompatibility', function () { */ destroy() { for (const component of children.get(this) || []) { + component.env.qweb.off("update", component); component.__destroy(); } children.delete(this); diff --git a/addons/web/static/tests/legacy/helpers/test_env.js b/addons/web/static/tests/legacy/helpers/test_env.js index ff6c0bf6b29..e335d59616a 100644 --- a/addons/web/static/tests/legacy/helpers/test_env.js +++ b/addons/web/static/tests/legacy/helpers/test_env.js @@ -4,6 +4,7 @@ odoo.define('web.test_env', async function (require) { const Bus = require('web.Bus'); const { buildQuery } = require('web.rpc'); const session = require('web.session'); + const { registerCleanup } = require("@web/../tests/helpers/cleanup"); let qweb; @@ -22,6 +23,9 @@ odoo.define('web.test_env', async function (require) { // time and they never change qweb = new owl.QWeb({ templates: session.owlTemplates }); } + registerCleanup(() => { + qweb.subscriptions = {}; + }); const defaultTranslationParamters = { code: "en_US",