From af85bb5e13b9c97d022a721bd782a37d718e4496 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Mon, 8 Jun 2020 11:50:24 +0000 Subject: [PATCH] [IMP] web,*: do not deploy services in tests *mail,point_of_sale,web_editor,website In the tests, required services are deployed for each test independently. There is no need to have, in additon, all services deployed globally. Worse, it could conflict and lead to unexpected results. This commit ensures services are no longer deployed globally in tests. It turns the module 'web.env' into a declarative module with no side-effect, by moving the service deployment to main.js, which isn't added to the tests page. Task 2287397 closes odoo/odoo#53817 Signed-off-by: Lucas Perais (lpe) --- .../static/src/{env/env.js => js/main.js} | 2 +- addons/mail/views/assets.xml | 7 ++- addons/point_of_sale/static/src/js/main.js | 2 + .../static/tests/unit/helpers/test_main.js | 17 +++++++ addons/web/static/src/js/common_env.js | 37 +-------------- .../static/src/js/core/abstract_service.js | 45 +++++++++++++++++++ addons/web/static/src/js/main.js | 11 ++--- .../src/js/public/public_root_instance.js | 6 +++ addons/web/static/tests/main_tests.js | 19 +++++--- addons/web/views/webclient_templates.xml | 7 ++- .../static/tests/field_html_tests.js | 8 ++++ .../src/js/content/website_root_instance.js | 13 ++++++ 12 files changed, 124 insertions(+), 50 deletions(-) rename addons/mail/static/src/{env/env.js => js/main.js} (97%) diff --git a/addons/mail/static/src/env/env.js b/addons/mail/static/src/js/main.js similarity index 97% rename from addons/mail/static/src/env/env.js rename to addons/mail/static/src/js/main.js index ea760ba6e11..95c8c4153b1 100644 --- a/addons/mail/static/src/env/env.js +++ b/addons/mail/static/src/js/main.js @@ -1,4 +1,4 @@ -odoo.define('mail/static/src/env/env.js', function (require) { +odoo.define('mail/static/src/js/main.js', function (require) { 'use strict'; const ModelManager = require('mail/static/src/model/model_manager.js'); diff --git a/addons/mail/views/assets.xml b/addons/mail/views/assets.xml index 1abab3c4fd8..8817822ef48 100644 --- a/addons/mail/views/assets.xml +++ b/addons/mail/views/assets.xml @@ -108,7 +108,6 @@ - @@ -213,6 +212,12 @@ + + + +