diff --git a/addons/mrp_subcontracting/__manifest__.py b/addons/mrp_subcontracting/__manifest__.py
index a7e2574d2f6..35c5d0de1fb 100644
--- a/addons/mrp_subcontracting/__manifest__.py
+++ b/addons/mrp_subcontracting/__manifest__.py
@@ -89,9 +89,7 @@
# Form style should be computed before
'web/static/src/views/form/button_box/*.scss',
- 'web/static/src/legacy/action_adapters.js',
'web/static/src/legacy/legacy_service_provider.js',
- 'web/static/src/legacy/legacy_client_actions.js',
'web/static/src/legacy/legacy_dialog.js',
'web/static/src/legacy/legacy_load_views.js',
'web/static/src/legacy/legacy_promise_error_handler.js',
@@ -102,11 +100,7 @@
'web/static/src/legacy/backend_utils.js',
'web/static/src/legacy/utils.js',
'web/static/src/legacy/web_client.js',
- 'web/static/src/legacy/js/chrome/*',
- 'web/static/src/legacy/js/components/*',
- 'web/static/src/legacy/js/control_panel/*',
'web/static/src/legacy/js/core/domain.js',
- 'web/static/src/legacy/js/core/mvc.js',
'web/static/src/legacy/js/core/py_utils.js',
'web/static/src/legacy/js/core/context.js',
'web/static/src/legacy/js/core/misc.js',
@@ -118,12 +112,7 @@
'web/static/src/legacy/js/fields/field_utils.js',
'web/static/src/legacy/js/services/data_manager.js',
'web/static/src/legacy/js/services/session.js',
- 'web/static/src/legacy/js/tools/tools.js',
'web/static/src/legacy/js/widgets/date_picker.js',
- 'web/static/src/legacy/js/widgets/domain_selector_dialog.js',
- 'web/static/src/legacy/js/widgets/domain_selector.js',
- 'web/static/src/legacy/js/widgets/model_field_selector.js',
- 'web/static/src/legacy/js/widgets/model_field_selector_popover.js',
'web/static/src/legacy/js/env.js',
'web/static/src/legacy/js/owl_compatibility.js',
'web/static/src/legacy/pseudo_web_client.js',
diff --git a/addons/point_of_sale/__manifest__.py b/addons/point_of_sale/__manifest__.py
index 0393ac77e6f..a312ffe5508 100644
--- a/addons/point_of_sale/__manifest__.py
+++ b/addons/point_of_sale/__manifest__.py
@@ -156,7 +156,6 @@
'web/static/src/legacy/js/**/*',
('remove', 'web/static/src/legacy/js/libs/**/*'),
('remove', 'web/static/src/legacy/js/public/**/*'),
- 'web/static/src/legacy/action_adapters.js',
'web/static/src/legacy/backend_utils.js',
'web/static/src/legacy/legacy_load_views.js',
'web/static/src/legacy/legacy_service_provider.js',
diff --git a/addons/project/__manifest__.py b/addons/project/__manifest__.py
index cbafebfcdd8..55339861096 100644
--- a/addons/project/__manifest__.py
+++ b/addons/project/__manifest__.py
@@ -140,9 +140,7 @@
# Form style should be computed before
'web/static/src/views/form/button_box/*.scss',
- 'web/static/src/legacy/action_adapters.js',
'web/static/src/legacy/legacy_service_provider.js',
- 'web/static/src/legacy/legacy_client_actions.js',
'web/static/src/legacy/legacy_dialog.js',
'web/static/src/legacy/legacy_load_views.js',
'web/static/src/legacy/legacy_promise_error_handler.js',
@@ -154,11 +152,7 @@
'web/static/src/legacy/utils.js',
'web/static/src/legacy/pseudo_web_client.js',
'web/static/src/legacy/web_client.js',
- 'web/static/src/legacy/js/chrome/*',
- 'web/static/src/legacy/js/components/*',
- 'web/static/src/legacy/js/control_panel/*',
'web/static/src/legacy/js/core/domain.js',
- 'web/static/src/legacy/js/core/mvc.js',
'web/static/src/legacy/js/core/py_utils.js',
'web/static/src/legacy/js/core/context.js',
'web/static/src/legacy/js/core/misc.js',
@@ -171,12 +165,7 @@
'web/static/src/legacy/js/fields/field_utils.js',
'web/static/src/legacy/js/services/data_manager.js',
'web/static/src/legacy/js/services/session.js',
- 'web/static/src/legacy/js/tools/tools.js',
'web/static/src/legacy/js/widgets/date_picker.js',
- 'web/static/src/legacy/js/widgets/domain_selector_dialog.js',
- 'web/static/src/legacy/js/widgets/domain_selector.js',
- 'web/static/src/legacy/js/widgets/model_field_selector.js',
- 'web/static/src/legacy/js/widgets/model_field_selector_popover.js',
'web/static/src/legacy/js/env.js',
'web/static/src/legacy/js/owl_compatibility.js',
diff --git a/addons/survey/static/tests/components/question_page_one2many_field_tests.js b/addons/survey/static/tests/components/question_page_one2many_field_tests.js
index 7e909ecb6d0..afc182029ce 100644
--- a/addons/survey/static/tests/components/question_page_one2many_field_tests.js
+++ b/addons/survey/static/tests/components/question_page_one2many_field_tests.js
@@ -2,6 +2,7 @@
import { makeServerError } from "@web/../tests/helpers/mock_server";
import { click, editInput, getFixture, nextTick, triggerHotkey } from "@web/../tests/helpers/utils";
+import { registerCleanup } from "@web/../tests/helpers/cleanup";
import { makeView, setupViewRegistries } from "@web/../tests/views/helpers";
import { errorService } from "@web/core/errors/error_service";
import { registry } from "@web/core/registry";
@@ -172,6 +173,12 @@ QUnit.module("QuestionPageOneToManyField", (hooks) => {
QUnit.test("A validation error from saving parent form notifies and prevents dialog from closing", async (assert) => {
registry.category("services").add("error", errorService);
+
+ // need to preventDefault to remove error from console (so python test pass)
+ const handler = (ev) => ev.preventDefault();
+ window.addEventListener("unhandledrejection", handler);
+ registerCleanup(() => window.removeEventListener("unhandledrejection", handler));
+
await makeView({
type: "form",
resModel: "survey",
diff --git a/addons/web/__manifest__.py b/addons/web/__manifest__.py
index 87af9250a1f..00735fdc53b 100644
--- a/addons/web/__manifest__.py
+++ b/addons/web/__manifest__.py
@@ -200,7 +200,6 @@ This module provides the core of the Odoo Web Client.
'web/static/lib/py.js/lib/py_extras.js',
'web/static/lib/jquery.ba-bbq/jquery.ba-bbq.js',
- 'web/static/src/legacy/scss/domain_selector.scss',
'web/static/src/legacy/scss/model_field_selector.scss',
'web/static/src/legacy/scss/dropdown.scss',
'web/static/src/legacy/scss/tooltip.scss',
@@ -217,9 +216,7 @@ 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/action_adapters.js',
'web/static/src/legacy/legacy_service_provider.js',
- 'web/static/src/legacy/legacy_client_actions.js',
'web/static/src/legacy/legacy_dialog.js',
'web/static/src/legacy/legacy_load_views.js',
'web/static/src/legacy/legacy_promise_error_handler.js',
@@ -229,24 +226,14 @@ This module provides the core of the Odoo Web Client.
'web/static/src/legacy/utils.js',
'web/static/src/legacy/pseudo_web_client.js',
'web/static/src/legacy/web_client.js',
- 'web/static/src/legacy/js/chrome/*',
- 'web/static/src/legacy/js/components/*',
- 'web/static/src/legacy/js/control_panel/*',
'web/static/src/legacy/js/core/domain.js',
- 'web/static/src/legacy/js/core/mvc.js',
'web/static/src/legacy/js/core/py_utils.js',
'web/static/src/legacy/js/core/context.js',
'web/static/src/legacy/js/core/misc.js',
'web/static/src/legacy/js/fields/*',
'web/static/src/legacy/js/services/data_manager.js',
'web/static/src/legacy/js/services/session.js',
- 'web/static/src/legacy/js/tools/tools.js',
- 'web/static/src/legacy/js/widgets/colorpicker_dialog.js',
'web/static/src/legacy/js/widgets/date_picker.js',
- 'web/static/src/legacy/js/widgets/domain_selector_dialog.js',
- 'web/static/src/legacy/js/widgets/domain_selector.js',
- 'web/static/src/legacy/js/widgets/model_field_selector.js',
- 'web/static/src/legacy/js/widgets/model_field_selector_popover.js',
'web/static/src/legacy/js/env.js',
'web/static/src/legacy/js/owl_compatibility.js',
@@ -653,7 +640,6 @@ This module provides the core of the Odoo Web Client.
# Legacy
'web/static/lib/tempusdominus/tempusdominus.js',
'web/static/tests/legacy/**/*.js',
- ('remove', 'web/static/tests/legacy/**/*_mobile_tests.js'),
('remove', 'web/static/tests/legacy/helpers/**/*.js'),
('remove', 'web/static/tests/legacy/legacy_setup.js'),
@@ -661,7 +647,6 @@ This module provides the core of the Odoo Web Client.
],
'web.qunit_mobile_suite_tests': [
'web/static/tests/mobile/**/*.js',
- 'web/static/tests/legacy/components/dropdown_menu_mobile_tests.js',
],
# Used during the transition of the web architecture
diff --git a/addons/web/static/src/legacy/action_adapters.js b/addons/web/static/src/legacy/action_adapters.js
deleted file mode 100644
index fa24d42f823..00000000000
--- a/addons/web/static/src/legacy/action_adapters.js
+++ /dev/null
@@ -1,244 +0,0 @@
-/** @odoo-module **/
-
-import Context from "web.Context";
-import core from "web.core";
-import { ComponentAdapter } from "web.OwlCompatibility";
-import { objectToQuery } from "../core/browser/router_service";
-import { useDebugCategory } from "../core/debug/debug_context";
-import { Dialog } from "../core/dialog/dialog";
-import { useService } from "@web/core/utils/hooks";
-import { cleanDomFromBootstrap, wrapSuccessOrFail, useLegacyRefs } from "./utils";
-import { mapDoActionOptionAPI } from "./backend_utils";
-
-import {
- Component,
- onMounted,
- onWillUnmount,
- onWillUpdateProps,
- useEffect,
- useExternalListener,
- xml,
-} from "@odoo/owl";
-
-class WarningDialog extends Component {}
-WarningDialog.template = xml``;
-WarningDialog.components = { Dialog };
-
-class ActionAdapter extends ComponentAdapter {
- setup() {
- super.setup();
- this.actionService = useService("action");
- this.router = useService("router");
- this.title = useService("title");
- this.notifications = useService("notification");
- this.dialogs = useService("dialog");
- this.wowlEnv = this.env;
- const legacyRefs = useLegacyRefs();
- legacyRefs.component = this;
- // a legacy widget widget can push_state anytime including during its async rendering
- // In Wowl, we want to have all states pushed during the same setTimeout.
- // This is protected in legacy (backward compatibility) but should not e supported in Wowl
- this.tempQuery = {};
- let originalUpdateControlPanel;
- useEffect(
- () => {
- legacyRefs.widget = this.widget;
- const query = this.widget.getState();
- Object.assign(query, this.tempQuery);
- this.tempQuery = null;
- this.__widget = this.widget;
- if (!this.wowlEnv.inDialog) {
- this.pushState(query);
- }
- const onActionManagerUpdate = () => {
- this.env.bus.trigger("close_dialogs");
- cleanDomFromBootstrap();
- };
- this.wowlEnv.bus.addEventListener("ACTION_MANAGER:UPDATE", onActionManagerUpdate);
- originalUpdateControlPanel = this.__widget.updateControlPanel.bind(this.__widget);
- this.__widget.updateControlPanel = (newProps) => {
- this.wowlEnv.config.setDisplayName(this.__widget.getTitle());
- return originalUpdateControlPanel(newProps);
- };
- core.bus.trigger("DOM_updated");
-
- return () => {
- this.__widget.updateControlPanel = originalUpdateControlPanel;
- this.wowlEnv.bus.removeEventListener(
- "ACTION_MANAGER:UPDATE",
- onActionManagerUpdate
- );
- };
- },
- () => []
- );
- useExternalListener(window, "click", () => {
- cleanDomFromBootstrap();
- });
-
- onWillUpdateProps(() => {
- if (this.widget === null) {
- this.widget = this.__widget;
- }
- });
- onWillUnmount(() => {
- if (this.__widget && this.__widget.on_detach_callback) {
- this.__widget.on_detach_callback();
- }
- });
-
- this.onScrollTo = (payload) => {
- const contentEl = this.el.querySelector(".o_content");
- if (contentEl) {
- contentEl.scrollLeft = payload.left || 0;
- contentEl.scrollTop = payload.top || 0;
- }
- };
- }
-
- get actionId() {
- throw new Error("Should be implement by specific adapters");
- }
-
- pushState(state) {
- if (this.wowlEnv.inDialog) {
- return;
- }
- const query = objectToQuery(state);
- if (this.tempQuery) {
- Object.assign(this.tempQuery, query);
- return;
- }
- if (this.widget) {
- const actionTitle = this.widget.getTitle();
- if (actionTitle) {
- this.wowlEnv.config.setDisplayName(actionTitle);
- }
- }
- if (this.props.onPushState) {
- this.props.onPushState(query);
- } else {
- this.router.pushState(query);
- }
- }
-
- _trigger_up(ev) {
- const payload = ev.data;
- if (ev.name === "do_action") {
- if (payload.action.context) {
- payload.action.context = new Context(payload.action.context).eval();
- }
- this.onReverseBreadcrumb = payload.options && payload.options.on_reverse_breadcrumb;
- const legacyOptions = mapDoActionOptionAPI(payload.options);
- wrapSuccessOrFail(this.actionService.doAction(payload.action, legacyOptions), payload);
- } else if (ev.name === "breadcrumb_clicked") {
- this.actionService.restore(payload.controllerID);
- } else if (ev.name === "push_state") {
- this.pushState(payload.state);
- } else if (ev.name === "set_title_part") {
- const { part, title } = payload;
- this.title.setParts({ [part]: title || null });
- } else if (ev.name === "warning") {
- if (payload.type === "dialog") {
- this.dialogs.add(WarningDialog, {
- title: payload.title,
- message: payload.message,
- });
- } else {
- this.notifications.add(payload.message, {
- className: payload.className,
- sticky: payload.sticky,
- title: payload.title,
- type: "warning",
- });
- }
- } else if (ev.name === "history_back") {
- this.wowlEnv.config.historyBack();
- } else if (ev.name === "scrollTo") {
- this.onScrollTo(payload);
- } else {
- super._trigger_up(ev);
- }
- }
-
- /**
- * This function is called just before the component will be unmounted,
- * because it will be replaced by another one. However, we need to keep it
- * alive, because we might come back to this one later. We thus return the
- * widget instance, and set this.widget to null so that it is not destroyed
- * by the compatibility layer. That instance will be destroyed by the
- * ActionManager service when it will be removed from the controller stack,
- * and if we ever come back to that controller, the instance will be given
- * in props so that we can re-use it.
- */
- exportState() {
- this.widget = null;
- return {
- __legacy_widget__: this.__widget,
- __on_reverse_breadcrumb__: this.onReverseBreadcrumb,
- };
- }
-
- canBeRemoved() {
- return this.__widget.canBeRemoved();
- }
-
- __destroy() {
- if (this.actionService.__legacy__isActionInStack(this.actionId)) {
- this.widget = null;
- }
- super.__destroy(...arguments);
- }
- get el() {
- return (this.widget || this.__widget).el;
- }
-}
-
-export class ClientActionAdapter extends ActionAdapter {
- setup() {
- super.setup();
- useDebugCategory("action", { action: this.props.widgetArgs[0] });
- onMounted(() => {
- const action = this.props.widgetArgs[0];
- if ("params" in action) {
- const newState = {};
- Object.entries(action.params).forEach(([k, v]) => {
- if (typeof v === "string" || typeof v === "number") {
- newState[k] = v;
- }
- });
- this.wowlEnv.services.router.pushState(newState);
- }
- });
- this.env = Component.env;
- }
-
- get actionId() {
- return this.props.widgetArgs[0].jsId;
- }
-
- async onWillStart() {
- if (this.props.widget) {
- this.widget = this.props.widget;
- this.widget.setParent(this);
- if (this.props.onReverseBreadcrumb) {
- await this.props.onReverseBreadcrumb();
- }
- return this.updateWidget();
- }
- return super.onWillStart();
- }
-
- /**
- * @override
- */
- updateWidget() {
- return this.widget.do_show();
- }
-
- do_push_state(state) {
- this.pushState(state);
- }
-}
diff --git a/addons/web/static/src/legacy/js/chrome/abstract_action.js b/addons/web/static/src/legacy/js/chrome/abstract_action.js
deleted file mode 100644
index 8ac1386619a..00000000000
--- a/addons/web/static/src/legacy/js/chrome/abstract_action.js
+++ /dev/null
@@ -1,82 +0,0 @@
-/** @odoo-module alias=web.AbstractAction **/
-
-/**
- * We define here the AbstractAction widget, which implements the ActionMixin.
- * All client actions must extend this widget.
- *
- * @module @web/chrome/abstract_action
- */
-
-import ActionMixin from "web.ActionMixin";
-import ControlPanel from "web.ControlPanel";
-import Widget from "web.Widget";
-import { ComponentWrapper } from "web.OwlCompatibility";
-
-const AbstractAction = Widget.extend(ActionMixin, {
- config: {
- ControlPanel: ControlPanel,
- },
-
- /**
- * If this flag is set to true, the client action will create a control
- * panel whenever it is created.
- *
- * @type boolean
- */
- hasControlPanel: false,
-
- /**
- * @override
- *
- * @param {Widget} parent
- * @param {Object} action
- * @param {Object} [options]
- */
- init: function (parent, action, options) {
- this._super(parent);
- this._title = action.display_name || action.name;
-
- if (this.hasControlPanel) {
- this.controlPanelProps = {
- action,
- breadcrumbs: options && options.breadcrumbs,
- };
- }
- },
- /**
- * @override
- */
- start: async function () {
- await this._super(...arguments);
- if (this.hasControlPanel) {
- if ('title' in this.controlPanelProps) {
- this._setTitle(this.controlPanelProps.title);
- }
- this.controlPanelProps.title = this.getTitle();
- this._controlPanelWrapper = new ComponentWrapper(this, this.config.ControlPanel, this.controlPanelProps);
- await this._controlPanelWrapper.mount(this.el, { position: 'first-child' });
-
- }
- },
- /**
- * @override
- */
- destroy: function() {
- this._super.apply(this, arguments);
- ActionMixin.destroy.call(this);
- },
- /**
- * @override
- */
- on_attach_callback: function () {
- ActionMixin.on_attach_callback.call(this);
- },
- /**
- * @override
- */
- on_detach_callback: function () {
- ActionMixin.on_detach_callback.call(this);
- },
-});
-
-export default AbstractAction;
diff --git a/addons/web/static/src/legacy/js/chrome/action_mixin.js b/addons/web/static/src/legacy/js/chrome/action_mixin.js
deleted file mode 100644
index 4b2f32a8079..00000000000
--- a/addons/web/static/src/legacy/js/chrome/action_mixin.js
+++ /dev/null
@@ -1,181 +0,0 @@
-/** @odoo-module alias=web.ActionMixin **/
-
- /**
- * We define here the ActionMixin, the generic notion of action (from the point
- * of view of the web client). In short, an action is a widget which controls
- * the main part of the screen (everything below the navbar).
- *
- * More precisely, the action manager is the component that coordinates a stack
- * of actions. Whenever the user navigates in the interface, switches views,
- * open different menus, the action manager creates/updates/destroys special
- * widgets which implements the ActionMixin. These actions need to answer to a
- * standardised API, which is the reason for this mixin.
- *
- * In practice, most actions are view controllers (coming from an
- * ir.action.act_window). However, some actions are 'client actions'. They
- * also need to implement the ActionMixin for a better cooperation with the
- * action manager.
- *
- * @module web.ActionMixin
- * @extends WidgetAdapterMixin
- */
-
- import core from "web.core";
- import { WidgetAdapterMixin } from "web.OwlCompatibility";
-
- const ActionMixin = Object.assign({}, WidgetAdapterMixin, {
- template: 'Action',
-
- /**
- * The action mixin assumes that it is rendered with the 'Action' template.
- * This template has a special zone ('.o_content') where the content should
- * be added. Actions that want to automatically render a template there
- * should define the contentTemplate key. In short, client actions should
- * probably define a contentTemplate key, and not a template key.
- */
- contentTemplate: null,
-
- /**
- * If an action wants to use a control panel, it will be created and
- * registered in this _controlPanel key (the widget). The way this control
- * panel is created is up to the implementation (so, view controllers or
- * client actions may have different needs).
- *
- * Note that most of the time, this key should be set by the framework, not
- * by the code of the client action.
- */
- _controlPanel: null,
-
- /**
- * String containing the title of the client action (which may be needed to
- * display in the breadcrumbs zone of the control panel).
- *
- * @see _setTitle
- */
- _title: '',
-
- /**
- * @override
- */
- renderElement: function () {
- this._super.apply(this, arguments);
- if (this.contentTemplate) {
- const content = core.qweb.render(this.contentTemplate, { widget: this });
- this.$('.o_content').append(content);
- }
- },
-
- /**
- * Called by the action manager when action is restored (typically, when
- * the user clicks on the action in the breadcrumb)
- *
- * @returns {Promise|undefined}
- */
- willRestore: function () { },
-
- //---------------------------------------------------------------------
- // Public
- //---------------------------------------------------------------------
-
- /**
- * In some situations, we need confirmation from the controller that the
- * current state can be destroyed without prejudice to the user. For
- * example, if the user has edited a form, maybe we should ask him if we
- * can discard all his changes when we switch to another action. In that
- * case, the action manager will call this method. If the returned
- * promise is successfully resolved, then we can destroy the current action,
- * otherwise, we need to stop.
- *
- * @returns {Promise} resolved if the action can be removed, rejected
- * otherwise
- */
- canBeRemoved: function () {
- return Promise.resolve();
- },
-
- /**
- * Returns a serializable state that will be pushed in the URL by
- * the action manager, allowing the action to be restarted correctly
- * upon refresh. This function should be overriden to add extra information.
- * Note that some keys are reserved by the framework and will thus be
- * ignored ('action', 'active_id', 'active_ids' and 'title', for all
- * actions, and 'model' and 'view_type' for act_window actions).
- *
- * @returns {Object}
- */
- getState: function () {
- return {};
- },
-
- /**
- * Returns a title that may be displayed in the breadcrumb area. For
- * example, the name of the record (for a form view). This is actually
- * important for the action manager: this is the way it is able to give
- * the proper titles for other actions.
- *
- * @returns {string}
- */
- getTitle: function () {
- return this._title;
- },
-
- /**
- * Renders the buttons to append, in most cases, to the control panel (in
- * the bottom left corner). When the action is rendered in a dialog, those
- * buttons might be moved to the dialog's footer.
- *
- * @param {jQuery Node} $node
- */
- renderButtons: function ($node) { },
-
- /**
- * Method used to update the widget buttons state.
- */
- updateButtons: function () { },
-
- /**
- * The parameter newProps is used to update the props of
- * the controlPanelWrapper before render it. The key 'cp_content'
- * is not a prop of the control panel itself. One should if possible use
- * the slot mechanism.
- *
- * @param {Object} [newProps={}]
- * @returns {Promise}
- */
- updateControlPanel: async function (newProps = {}) {
- if (!this.withControlPanel && !this.hasControlPanel) {
- return;
- }
- const props = Object.assign({}, newProps); // Work with a clean new object
- if ('title' in props) {
- this._setTitle(props.title);
- this.controlPanelProps.title = this.getTitle();
- delete props.title;
- }
- if ('cp_content' in props) {
- // cp_content has been updated: refresh it.
- this.controlPanelProps.cp_content = Object.assign({},
- this.controlPanelProps.cp_content,
- props.cp_content,
- );
- delete props.cp_content;
- }
- // Update props state
- Object.assign(this.controlPanelProps, props);
- return this._controlPanelWrapper.update(this.controlPanelProps);
- },
-
- //---------------------------------------------------------------------
- // Private
- //---------------------------------------------------------------------
-
- /**
- * @private
- * @param {string} title
- */
- _setTitle: function (title) {
- this._title = title;
- },
- });
-
- export default ActionMixin;
diff --git a/addons/web/static/src/legacy/js/components/action_menus.js b/addons/web/static/src/legacy/js/components/action_menus.js
deleted file mode 100644
index c93e6e976f6..00000000000
--- a/addons/web/static/src/legacy/js/components/action_menus.js
+++ /dev/null
@@ -1,206 +0,0 @@
-/** @odoo-module alias=web.ActionMenus **/
-
- import Context from "web.Context";
- import DropdownMenu from "web.DropdownMenu";
- import Registry from "web.Registry";
- import { LegacyComponent } from "@web/legacy/legacy_component";
-
- const {
- onMounted,
- onPatched,
- onWillStart,
- onWillUpdateProps,
- } = owl;
-
- let registryActionId = 1;
-
- /**
- * Action menus (or Action/Print bar, previously called 'Sidebar')
- *
- * The side bar is the group of dropdown menus located on the left side of the
- * control panel. Its role is to display a list of items depending on the view
- * type and selected records and to execute a set of actions on active records.
- * It is made out of 2 dropdown menus: Print and Action.
- *
- * This component also provides a registry to use custom components in the ActionMenus's
- * Action menu.
- * @extends Component
- */
- class ActionMenus extends LegacyComponent {
- setup() {
- this.actionButtonStrings = {
- title: this.env._t("Action"),
- hotkey: this.env._t("Additionnal actions"),
- };
- this.printButtonStrings = {
- title: this.env._t("Print"),
- hotkey: this.env._t("Printing options"),
- };
- onWillStart(async () => {
- this.actionItems = await this._setActionItems(this.props);
- this.printItems = await this._setPrintItems(this.props);
- });
- onWillUpdateProps(async (nextProps) => {
- this.actionItems = await this._setActionItems(nextProps);
- this.printItems = await this._setPrintItems(nextProps);
- });
- onMounted(() => {
- this._addTooltips();
- });
- onPatched(() => {
- this._addTooltips();
- });
- }
-
- //---------------------------------------------------------------------
- // Private
- //---------------------------------------------------------------------
-
- /**
- * Add the tooltips to the items
- * @private
- */
- _addTooltips() {
- $(this.el.querySelectorAll('[title]')).tooltip({
- delay: { show: 500, hide: 0 }
- });
- }
-
- /**
- * @private
- * @param {Object} props
- * @returns {Promise