diff --git a/addons/mrp_subcontracting/__manifest__.py b/addons/mrp_subcontracting/__manifest__.py index 7691a0caf89..8088babfd78 100644 --- a/addons/mrp_subcontracting/__manifest__.py +++ b/addons/mrp_subcontracting/__manifest__.py @@ -129,8 +129,6 @@ # Form style should be computed before 'web/static/src/views/form/button_box/*.scss', - 'web/static/src/legacy/utils.js', - 'mrp_subcontracting/static/src/subcontracting_portal/*', 'web/static/src/start.js', ], diff --git a/addons/point_of_sale/__manifest__.py b/addons/point_of_sale/__manifest__.py index 901b6fa1896..dce9001d7e6 100644 --- a/addons/point_of_sale/__manifest__.py +++ b/addons/point_of_sale/__manifest__.py @@ -157,7 +157,6 @@ 'web/static/src/legacy/js/**/*', ('remove', 'web/static/src/legacy/js/libs/**/*'), ('remove', 'web/static/src/legacy/js/public/**/*'), - 'web/static/src/legacy/utils.js', 'web/static/src/search/**/*', 'web/static/src/views/fields/field_tooltip.js', 'web/static/src/views/fields/field.js', diff --git a/addons/project/__manifest__.py b/addons/project/__manifest__.py index 2420bd4926b..241f69174c0 100644 --- a/addons/project/__manifest__.py +++ b/addons/project/__manifest__.py @@ -178,8 +178,6 @@ # Form style should be computed before 'web/static/src/views/form/button_box/*.scss', - 'web/static/src/legacy/utils.js', - 'web_editor/static/src/js/editor/odoo-editor/src/base_style.scss', 'web_editor/static/lib/vkbeautify/**/*', 'web_editor/static/src/js/common/**/*', diff --git a/addons/web/__manifest__.py b/addons/web/__manifest__.py index 77583262815..2627e7c0310 100644 --- a/addons/web/__manifest__.py +++ b/addons/web/__manifest__.py @@ -116,8 +116,6 @@ This module provides the core of the Odoo Web Client. # Form style should be computed before 'web/static/src/views/form/button_box/*.scss', - 'web/static/src/legacy/utils.js', - 'web/static/src/legacy/xml/base.xml', # Don't include dark mode files in light mode ('remove', 'web/static/src/**/*.dark.scss'), @@ -218,7 +216,6 @@ This module provides the core of the Odoo Web Client. 'web/static/src/public/datetime_picker_widget.js', 'web/static/src/libs/pdfjs.js', - 'web/static/src/legacy/utils.js', 'web/static/src/legacy/js/public/public_root.js', 'web/static/src/legacy/js/public/public_root_instance.js', 'web/static/src/legacy/js/public/public_widget.js', diff --git a/addons/web/static/src/legacy/js/public/public_root.js b/addons/web/static/src/legacy/js/public/public_root.js index 27bb5bc46dd..a87c2d1a98e 100644 --- a/addons/web/static/src/legacy/js/public/public_root.js +++ b/addons/web/static/src/legacy/js/public/public_root.js @@ -7,8 +7,6 @@ import { registry } from '@web/core/registry'; import lazyloader from "@web/legacy/js/public/lazyloader"; -import { createWidgetParent } from "../../utils"; - import { makeEnv, startServices } from "@web/env"; import { loadJS, templates } from '@web/core/assets'; import { MainComponentsContainer } from "@web/core/main_components_container"; @@ -322,7 +320,7 @@ export async function createPublicRoot(RootWidget) { await startServices(env); Component.env = env; await env.services.public_component.mountComponents(); - const publicRoot = new RootWidget(createWidgetParent(env), env); + const publicRoot = new RootWidget(null, env); const app = new App(MainComponentsContainer, { templates, env, diff --git a/addons/web/static/src/legacy/utils.js b/addons/web/static/src/legacy/utils.js index 6dea3a5206c..59a4a546b5e 100644 --- a/addons/web/static/src/legacy/utils.js +++ b/addons/web/static/src/legacy/utils.js @@ -4,33 +4,6 @@ import { App, Component, useState, xml } from "@odoo/owl"; import { templates } from "@web/core/assets"; import { _t } from "@web/core/l10n/translation"; -const reBSTooltip = /^bs-.*$/; - -export function cleanDomFromBootstrap() { - const body = document.body; - // multiple bodies in tests - // Bootstrap tooltips - const tooltips = body.querySelectorAll("body .tooltip"); - for (const tt of tooltips) { - if (Array.from(tt.classList).find((cls) => reBSTooltip.test(cls))) { - tt.parentNode.removeChild(tt); - } - } -} - -export function createWidgetParent(env) { - return { - env, - _trigger_up: (ev) => { - if (ev.name === "call_service") { - const service = env.services[ev.data.service]; - const result = service[ev.data.method].apply(service, ev.data.args || []); - ev.data.callback(result); - } - }, - }; -} - const rootTemplate = xml``; export async function attachComponent(parent, element, componentClass, props = {}) { class Root extends Component { diff --git a/addons/web/static/src/webclient/actions/action_service.js b/addons/web/static/src/webclient/actions/action_service.js index de0dff5eaa3..31c3a57baab 100644 --- a/addons/web/static/src/webclient/actions/action_service.js +++ b/addons/web/static/src/webclient/actions/action_service.js @@ -8,7 +8,6 @@ import { evaluateExpr } from "@web/core/py_js/py"; import { registry } from "@web/core/registry"; import { Deferred, KeepLast } from "@web/core/utils/concurrency"; import { useBus, useService } from "@web/core/utils/hooks"; -import { cleanDomFromBootstrap } from "@web/legacy/utils"; import { View, ViewNotFoundError } from "@web/views/view"; import { ActionDialog } from "./action_dialog"; import { CallbackRecorder } from "./action_hook"; @@ -678,7 +677,6 @@ function makeActionManager(env) { if (!this.isMounted) { reject(error); } - cleanDomFromBootstrap(); if (this.isMounted) { // the error occurred on the controller which is // already in the DOM, so simply show the error @@ -775,7 +773,6 @@ function makeActionManager(env) { }; let nextDialog = null; if (action.target === "new") { - cleanDomFromBootstrap(); const actionDialogProps = { ActionComponent: ControllerComponent, actionProps: controller.props, @@ -796,7 +793,6 @@ function makeActionManager(env) { if (onClose) { onClose(); } - cleanDomFromBootstrap(); }, }); nextDialog = { diff --git a/addons/web_editor/__manifest__.py b/addons/web_editor/__manifest__.py index bcfeef9bf7d..8a4d6df0c70 100644 --- a/addons/web_editor/__manifest__.py +++ b/addons/web_editor/__manifest__.py @@ -104,6 +104,7 @@ Odoo Web Editor widget. 'web/static/src/legacy/js/core/mixins.js', 'web/static/src/legacy/js/core/service_mixins.js', 'web/static/src/legacy/js/core/widget.js', + 'web/static/src/legacy/utils.js', # lib 'web_editor/static/lib/cropperjs/cropper.css', @@ -203,6 +204,9 @@ Odoo Web Editor widget. 'web_editor/static/src/js/frontend/loader_loading.js', ], 'web.assets_frontend': [ + # legacy stuff that are no longer in assets_backend + 'web/static/src/legacy/utils.js', + ('include', 'web_editor.assets_media_dialog'), 'web_editor/static/src/js/editor/odoo-editor/src/base_style.scss',