diff --git a/addons/account/static/src/js/account_portal.js b/addons/account/static/src/js/account_portal.js index d0a5330411d53..c6e21c716f586 100644 --- a/addons/account/static/src/js/account_portal.js +++ b/addons/account/static/src/js/account_portal.js @@ -1,9 +1,8 @@ /** @odoo-module */ -import publicWidget from 'web.public.widget'; -import "@portal/js/portal"; // force dependencies +import { PortalHomeCounters } from '@portal/js/portal'; -publicWidget.registry.PortalHomeCounters.include({ +PortalHomeCounters.include({ /** * @override */ diff --git a/addons/account/static/src/js/account_portal_sidebar.js b/addons/account/static/src/js/account_portal_sidebar.js index 44e9fc5336f6a..5d32f06c08670 100644 --- a/addons/account/static/src/js/account_portal_sidebar.js +++ b/addons/account/static/src/js/account_portal_sidebar.js @@ -1,9 +1,9 @@ /** @odoo-module **/ -import dom from "web.dom"; -import publicWidget from "web.public.widget"; -import PortalSidebar from "portal.PortalSidebar"; -import utils from "web.utils"; +import dom from "@web/legacy/js/core/dom"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import PortalSidebar from "@portal/js/portal_sidebar"; +import utils from "@web/legacy/js/core/utils"; publicWidget.registry.AccountPortalSidebar = PortalSidebar.extend({ selector: '.o_portal_invoice_sidebar', diff --git a/addons/account/static/src/js/tours/account.js b/addons/account/static/src/js/tours/account.js index 76572ff5b37e1..dca54e9ae8d90 100644 --- a/addons/account/static/src/js/tours/account.js +++ b/addons/account/static/src/js/tours/account.js @@ -1,10 +1,10 @@ -/** @odoo-module alias=account.tour **/ +/** @odoo-module **/ -import core from "web.core"; -import {Markup} from "web.utils"; +import core from "@web/legacy/js/services/core"; +import { Markup } from "@web/legacy/js/core/utils"; import { registry } from "@web/core/registry"; import { stepUtils } from "@web_tour/tour_service/tour_utils"; -import "web.legacy_tranlations_loaded"; +import "@web/legacy/translations_loaded"; var _t = core._t; diff --git a/addons/account/static/tests/tours/account_dashboard_setup_bar_tests.js b/addons/account/static/tests/tours/account_dashboard_setup_bar_tests.js index 5f30c00d0a3d8..0720b246492d6 100644 --- a/addons/account/static/tests/tours/account_dashboard_setup_bar_tests.js +++ b/addons/account/static/tests/tours/account_dashboard_setup_bar_tests.js @@ -1,9 +1,9 @@ -/** @odoo-module alias=account.dashboard.setup.tour **/ - - import core from "web.core"; +/** @odoo-module **/ + + import core from "@web/legacy/js/services/core"; import { registry } from "@web/core/registry"; import { stepUtils } from "@web_tour/tour_service/tour_utils"; - import "web.legacy_tranlations_loaded"; + import "@web/legacy/translations_loaded"; var _t = core._t; diff --git a/addons/account/static/tests/tours/tax_group_tests.js b/addons/account/static/tests/tours/tax_group_tests.js index 57086ff664989..9f8b87ca63f84 100644 --- a/addons/account/static/tests/tours/tax_group_tests.js +++ b/addons/account/static/tests/tours/tax_group_tests.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=account.tax.group.tour.tests */ +/** @odoo-module */ "use strict"; import { registry } from "@web/core/registry"; diff --git a/addons/account_payment/static/src/js/payment_form.js b/addons/account_payment/static/src/js/payment_form.js index bffd3d95b3eba..c15fffb386d8d 100644 --- a/addons/account_payment/static/src/js/payment_form.js +++ b/addons/account_payment/static/src/js/payment_form.js @@ -1,7 +1,7 @@ /** @odoo-module **/ - - import checkoutForm from "payment.checkout_form"; - import manageForm from "payment.manage_form"; + + import checkoutForm from "@payment/js/checkout_form"; + import manageForm from "@payment/js/manage_form"; const PaymentMixin = { @@ -12,7 +12,7 @@ /** * Add `invoice_id` to the transaction route params if it is provided. * - * @override method from payment.payment_form_mixin + * @override method from @payment/js/payment_form_mixin * @private * @param {string} code - The provider code of the selected payment option. * @param {number} paymentOptionId - The id of the selected payment option. diff --git a/addons/auth_password_policy_signup/static/src/js/password_meter.js b/addons/auth_password_policy_signup/static/src/js/password_meter.js index 7f6a0eee3a89e..f5d249a889478 100644 --- a/addons/auth_password_policy_signup/static/src/js/password_meter.js +++ b/addons/auth_password_policy_signup/static/src/js/password_meter.js @@ -1,7 +1,7 @@ /** @odoo-module */ -import { _t } from "web.core"; -import Widget from "web.Widget"; +import { _t } from "@web/legacy/js/services/core"; +import Widget from "@web/legacy/js/core/widget"; import { computeScore } from "@auth_password_policy/password_policy"; import { sprintf } from "@web/core/utils/strings"; import { translationIsReady } from "@web/core/l10n/translation"; diff --git a/addons/auth_signup/static/src/js/signup.js b/addons/auth_signup/static/src/js/signup.js index c408a8b4eed5c..6a3e97a1db21a 100644 --- a/addons/auth_signup/static/src/js/signup.js +++ b/addons/auth_signup/static/src/js/signup.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import publicWidget from "web.public.widget"; +import publicWidget from "@web/legacy/js/public/public_widget"; publicWidget.registry.SignUpForm = publicWidget.Widget.extend({ selector: '.oe_signup_form', diff --git a/addons/auth_totp/static/tests/totp_flow.js b/addons/auth_totp/static/tests/totp_flow.js index d5b9cd270b26b..aad2e2050d8ae 100644 --- a/addons/auth_totp/static/tests/totp_flow.js +++ b/addons/auth_totp/static/tests/totp_flow.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import ajax from "web.ajax"; +import ajax from "@web/legacy/js/core/ajax"; import { registry } from "@web/core/registry"; import { stepUtils } from "@web_tour/tour_service/tour_utils"; diff --git a/addons/auth_totp_portal/static/src/js/totp_frontend.js b/addons/auth_totp_portal/static/src/js/totp_frontend.js index c8c916bae8d6a..e80d9e3bde3bb 100644 --- a/addons/auth_totp_portal/static/src/js/totp_frontend.js +++ b/addons/auth_totp_portal/static/src/js/totp_frontend.js @@ -1,9 +1,9 @@ /** @odoo-module **/ -import {_t} from "web.core"; -import publicWidget from "web.public.widget"; -import Dialog from "web.Dialog"; -import {handleCheckIdentity} from "portal.security"; +import {_t} from "@web/legacy/js/services/core"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import Dialog from "@web/legacy/js/core/dialog"; +import {handleCheckIdentity} from "@portal/js/portal_security"; /** * Replaces specific elements by normal HTML, strip out the rest entirely diff --git a/addons/auth_totp_portal/static/tests/totp_portal.js b/addons/auth_totp_portal/static/tests/totp_portal.js index a1c4b30f8f1ff..7331bc15d9cce 100644 --- a/addons/auth_totp_portal/static/tests/totp_portal.js +++ b/addons/auth_totp_portal/static/tests/totp_portal.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import ajax from "web.ajax"; +import ajax from "@web/legacy/js/core/ajax"; import { registry } from "@web/core/registry"; registry.category("web_tour.tours").add('totportal_tour_setup', { diff --git a/addons/barcodes/static/src/js/barcode_events.js b/addons/barcodes/static/src/js/barcode_events.js index ee18c54aab7ba..735d4f8d56f3f 100644 --- a/addons/barcodes/static/src/js/barcode_events.js +++ b/addons/barcodes/static/src/js/barcode_events.js @@ -2,15 +2,15 @@ /** * BarcodeEvents has been removed and replaced by the barcode service. - * + * * This file is a temporary service to remap barcode events from new barcode * service to core.bus (which was the purpose of BarcodeEvents). - * + * * @TODO: remove this as soon as all barcode code is using new barcode service */ import { registry } from "@web/core/registry"; -import core from "web.core"; +import core from "@web/legacy/js/services/core"; export const barcodeRemapperService = { dependencies: ["barcode"], diff --git a/addons/barcodes/static/tests/mobile/barcode_mobile_tests.js b/addons/barcodes/static/tests/mobile/barcode_mobile_tests.js index 7517d5dbf1b54..fb43673e44573 100644 --- a/addons/barcodes/static/tests/mobile/barcode_mobile_tests.js +++ b/addons/barcodes/static/tests/mobile/barcode_mobile_tests.js @@ -1,10 +1,10 @@ /** @odoo-module **/ - + import {barcodeService} from "@barcodes/barcode_service"; import {barcodeRemapperService} from "@barcodes/js/barcode_events"; import { makeTestEnv } from "@web/../tests/helpers/mock_env"; import { registry } from "@web/core/registry"; - import testUtils from "web.test_utils"; + import testUtils from "@web/../tests/legacy/helpers/test_utils"; const maxTimeBetweenKeysInMs = barcodeService.maxTimeBetweenKeysInMs; const isMobileChrome = barcodeService.isMobileChrome; @@ -24,7 +24,7 @@ keyCode: keycode, }); } - + QUnit.module('Barcodes', { before() { barcodeService.maxTimeBetweenKeysInMs = 0; @@ -81,7 +81,7 @@ $element = $form.find('input[name=' + keepFocusedElements[i] + ']'); $element.focus(); triggerKeyDown('c', $element[0]); - + assert.strictEqual(document.activeElement, $element[0], "input " + keepFocusedElements[i] + " should keep focus"); } diff --git a/addons/board/static/tests/add_to_dashboard_tests.js b/addons/board/static/tests/add_to_dashboard_tests.js index 7f96567e2ac44..f0582a2e92a88 100644 --- a/addons/board/static/tests/add_to_dashboard_tests.js +++ b/addons/board/static/tests/add_to_dashboard_tests.js @@ -19,7 +19,7 @@ import { import { createWebClient, doAction } from "@web/../tests/webclient/helpers"; import { browser } from "@web/core/browser/browser"; import { registry } from "@web/core/registry"; -import testUtils from "web.test_utils"; +import testUtils from "@web/../tests/legacy/helpers/test_utils"; import { makeFakeUserService } from "@web/../tests/helpers/mock_services"; const patchDate = testUtils.mock.patchDate; diff --git a/addons/bus/static/src/services/presence_service.js b/addons/bus/static/src/services/presence_service.js index 882059f09fdfa..b8a298475e874 100644 --- a/addons/bus/static/src/services/presence_service.js +++ b/addons/bus/static/src/services/presence_service.js @@ -2,7 +2,7 @@ import { browser } from "@web/core/browser/browser"; import { registry } from "@web/core/registry"; -import core from "web.core"; +import core from "@web/legacy/js/services/core"; export const presenceService = { start(env) { diff --git a/addons/bus/static/tests/helpers/mock_python_environment.js b/addons/bus/static/tests/helpers/mock_python_environment.js index adf79f77ac72b..a4a224560897f 100644 --- a/addons/bus/static/tests/helpers/mock_python_environment.js +++ b/addons/bus/static/tests/helpers/mock_python_environment.js @@ -5,7 +5,7 @@ import { TEST_USER_IDS } from "@bus/../tests/helpers/test_constants"; import { registry } from "@web/core/registry"; import { registerCleanup } from "@web/../tests/helpers/cleanup"; import { makeMockServer } from "@web/../tests/helpers/mock_server"; -import core from "web.core"; +import core from "@web/legacy/js/services/core"; const modelDefinitionsPromise = new Promise((resolve) => { QUnit.begin(() => resolve(getModelDefinitions())); diff --git a/addons/calendar/static/src/activity/activity_menu_patch.js b/addons/calendar/static/src/activity/activity_menu_patch.js index cc839593784ca..5979974b2ac59 100644 --- a/addons/calendar/static/src/activity/activity_menu_patch.js +++ b/addons/calendar/static/src/activity/activity_menu_patch.js @@ -2,8 +2,8 @@ import { ActivityMenu } from "@mail/core/web/activity_menu"; import { patch } from "@web/core/utils/patch"; -import fieldUtils from "web.field_utils"; -import { getLangTimeFormat } from "web.time"; +import fieldUtils from "@web/legacy/js/fields/field_utils"; +import time from "@web/legacy/js/core/time"; patch(ActivityMenu.prototype, "calendar", { async fetchSystrayActivities() { @@ -16,7 +16,7 @@ patch(ActivityMenu.prototype, "calendar", { fieldUtils.parse.datetime(meeting.start, false, { isUTC: true }) ) .local() - .format(getLangTimeFormat()); + .format(time.getLangTimeFormat()); } } } diff --git a/addons/calendar/static/tests/helpers/mock_server/models/res_users.js b/addons/calendar/static/tests/helpers/mock_server/models/res_users.js index 65c4026ba7503..58078fafdfd6a 100644 --- a/addons/calendar/static/tests/helpers/mock_server/models/res_users.js +++ b/addons/calendar/static/tests/helpers/mock_server/models/res_users.js @@ -6,7 +6,7 @@ import '@mail/../tests/helpers/mock_server/models/res_users'; import { patch } from '@web/core/utils/patch'; import { MockServer } from '@web/../tests/helpers/mock_server'; -import { datetime_to_str } from 'web.time'; +import { datetime_to_str } from '@web/legacy/js/core/time'; patch(MockServer.prototype, 'calendar/models/res_users', { /** diff --git a/addons/crm/static/src/js/tours/crm.js b/addons/crm/static/src/js/tours/crm.js index 9a8a1bb5b7d09..3b10683320695 100644 --- a/addons/crm/static/src/js/tours/crm.js +++ b/addons/crm/static/src/js/tours/crm.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import { _t } from 'web.core'; -import "web.legacy_tranlations_loaded"; -import { Markup } from 'web.utils'; +import { _t } from "@web/legacy/js/services/core"; +import "@web/legacy/translations_loaded"; +import { Markup } from "@web/legacy/js/core/utils"; import { registry } from "@web/core/registry"; import { stepUtils } from "@web_tour/tour_service/tour_utils"; diff --git a/addons/crm/static/tests/forecast_kanban_tests.js b/addons/crm/static/tests/forecast_kanban_tests.js index c89ad9fb2389d..16845a028b398 100644 --- a/addons/crm/static/tests/forecast_kanban_tests.js +++ b/addons/crm/static/tests/forecast_kanban_tests.js @@ -179,7 +179,7 @@ QUnit.module('Crm Fill Temporal Service', { }, function () { /** - * Since mock_server does not support fill_temporal, + * Since mock_server does not support fill_temporal, * we only check the domain and the context sent to the read_group, as well * as the end value of the FillTemporal Service after the read_group (which should have been updated in the model) */ @@ -221,7 +221,7 @@ QUnit.module('Crm Fill Temporal Service', { }); /** - * Since mock_server does not support fill_temporal, + * Since mock_server does not support fill_temporal, * we only check the domain and the context sent to the read_group, as well * as the end value of the FillTemporal Service after the read_group (which should have been updated in the model) */ diff --git a/addons/crm/static/tests/forecast_view_tests.js b/addons/crm/static/tests/forecast_view_tests.js index 3f72591c5520d..8250974ac3d9f 100644 --- a/addons/crm/static/tests/forecast_view_tests.js +++ b/addons/crm/static/tests/forecast_view_tests.js @@ -9,7 +9,7 @@ import { } from "@web/../tests/search/helpers"; import { makeView, setupViewRegistries } from "@web/../tests/views/helpers"; import { registry } from "@web/core/registry"; -import { mock } from "web.test_utils"; +import { mock } from "@web/../tests/legacy/helpers/test_utils"; import { browser } from "@web/core/browser/browser"; import { fakeCookieService } from "@web/../tests/helpers/mock_services"; diff --git a/addons/crm_iap_mine/static/src/js/tours/crm_iap_lead.js b/addons/crm_iap_mine/static/src/js/tours/crm_iap_lead.js index 6f551e1fb3803..220e51985742f 100644 --- a/addons/crm_iap_mine/static/src/js/tours/crm_iap_lead.js +++ b/addons/crm_iap_mine/static/src/js/tours/crm_iap_lead.js @@ -1,9 +1,9 @@ /** @odoo-module **/ import { registry } from "@web/core/registry"; -import { Markup } from "web.utils"; -import core from "web.core"; -import "web.legacy_tranlations_loaded"; +import { Markup } from "@web/legacy/js/core/utils"; +import core from "@web/legacy/js/services/core"; +import "@web/legacy/translations_loaded"; import "@crm/js/tours/crm"; import { patch } from "@web/core/utils/patch"; diff --git a/addons/event/static/src/js/tours/event_steps.js b/addons/event/static/src/js/tours/event_steps.js index ae2ed0dbf6a64..a73ec6d9977f3 100644 --- a/addons/event/static/src/js/tours/event_steps.js +++ b/addons/event/static/src/js/tours/event_steps.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=event.event_steps **/ +/** @odoo-module **/ -import core from "web.core"; +import core from "@web/legacy/js/services/core"; var EventAdditionalTourSteps = core.Class.extend({ diff --git a/addons/event/static/src/js/tours/event_tour.js b/addons/event/static/src/js/tours/event_tour.js index 0a82f2b5053f9..38f901fe403e6 100644 --- a/addons/event/static/src/js/tours/event_tour.js +++ b/addons/event/static/src/js/tours/event_tour.js @@ -1,12 +1,12 @@ /** @odoo-module **/ -import {_t} from "web.core"; -import {Markup} from "web.utils"; +import {_t} from "@web/legacy/js/services/core"; +import { Markup } from "@web/legacy/js/core/utils"; import { registry } from "@web/core/registry"; import { stepUtils } from "@web_tour/tour_service/tour_utils"; -import "web.legacy_tranlations_loaded"; +import "@web/legacy/translations_loaded"; -import EventAdditionalTourSteps from "event.event_steps"; +import EventAdditionalTourSteps from "@event/js/tours/event_steps"; registry.category("web_tour.tours").add('event_tour', { url: '/web', diff --git a/addons/google_recaptcha/static/src/js/recaptcha.js b/addons/google_recaptcha/static/src/js/recaptcha.js index 6ac81a13322f4..87f7a58e0599b 100644 --- a/addons/google_recaptcha/static/src/js/recaptcha.js +++ b/addons/google_recaptcha/static/src/js/recaptcha.js @@ -1,13 +1,13 @@ -/** @odoo-module alias=google_recaptcha.ReCaptchaV3 **/ +/** @odoo-module **/ -import Class from "web.Class"; -import core from "web.core"; +import Class from "@web/legacy/js/core/class"; +import core from "@web/legacy/js/services/core"; import { session } from "@web/session"; import { loadJS } from "@web/core/assets"; const _t = core._t; -const ReCaptcha = Class.extend({ +export const ReCaptcha = Class.extend({ /** * @override */ diff --git a/addons/hr/static/src/js/m2x_avatar_employee.js b/addons/hr/static/src/js/m2x_avatar_employee.js index 6b3a4ec19ca00..f2c8fccde033d 100644 --- a/addons/hr/static/src/js/m2x_avatar_employee.js +++ b/addons/hr/static/src/js/m2x_avatar_employee.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=hr.Many2OneAvatarEmployee **/ +/** @odoo-module **/ -import fieldRegistry from "web.field_registry"; +import fieldRegistry from "@web/legacy/js/fields/field_registry"; import { Many2OneAvatarUser, diff --git a/addons/hr/static/src/messaging_service_patch.js b/addons/hr/static/src/messaging_service_patch.js index 09a44a724fb0a..78ae134bb3cc0 100644 --- a/addons/hr/static/src/messaging_service_patch.js +++ b/addons/hr/static/src/messaging_service_patch.js @@ -2,7 +2,7 @@ import { Messaging } from "@mail/core/common/messaging_service"; -import { patch } from "web.utils"; +import { patch } from '@web/legacy/js/core/utils'; patch(Messaging.prototype, "hr", { setup(...args) { diff --git a/addons/hr/static/src/thread_service_patch.js b/addons/hr/static/src/thread_service_patch.js index 9da0f1b3bd9c0..a834e22c33b1b 100644 --- a/addons/hr/static/src/thread_service_patch.js +++ b/addons/hr/static/src/thread_service_patch.js @@ -2,7 +2,7 @@ import { _t } from "@web/core/l10n/translation"; import { ThreadService } from "@mail/core/common/thread_service"; -import { patch } from "web.utils"; +import { patch } from '@web/legacy/js/core/utils'; /** @type {import("@mail/core/common/thread_service").ThreadService} */ const threadServicePatch = { diff --git a/addons/hr/static/tests/m2x_avatar_employee_tests.js b/addons/hr/static/tests/m2x_avatar_employee_tests.js index 5f4cc2ae7afab..1260c45989400 100644 --- a/addons/hr/static/tests/m2x_avatar_employee_tests.js +++ b/addons/hr/static/tests/m2x_avatar_employee_tests.js @@ -5,7 +5,7 @@ import { afterNextRender, start, startServer } from "@mail/../tests/helpers/test import { makeFakeNotificationService } from "@web/../tests/helpers/mock_services"; import { Many2OneAvatarEmployee } from "@hr/js/m2x_avatar_employee"; -import { dom } from "web.test_utils"; +import { dom } from "@web/../tests/legacy/helpers/test_utils"; QUnit.module("M2XAvatarEmployee", { beforeEach() { diff --git a/addons/hr_expense/static/src/js/tours/hr_expense.js b/addons/hr_expense/static/src/js/tours/hr_expense.js index dc0efa89ec3d3..73aaaaa26a7a7 100644 --- a/addons/hr_expense/static/src/js/tours/hr_expense.js +++ b/addons/hr_expense/static/src/js/tours/hr_expense.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import {_t} from "web.core"; -import "web.legacy_tranlations_loaded"; -import {Markup} from "web.utils"; +import {_t} from "@web/legacy/js/services/core"; +import "@web/legacy/translations_loaded"; +import { Markup } from "@web/legacy/js/core/utils"; import { registry } from "@web/core/registry"; import { stepUtils } from "@web_tour/tour_service/tour_utils"; diff --git a/addons/hr_holidays/static/src/dashboard/time_off_card.js b/addons/hr_holidays/static/src/dashboard/time_off_card.js index 70440fcd00e37..e8fc65f8d9ff7 100644 --- a/addons/hr_holidays/static/src/dashboard/time_off_card.js +++ b/addons/hr_holidays/static/src/dashboard/time_off_card.js @@ -1,6 +1,6 @@ /* @odoo-module */ -import Popover from "web.Popover"; +import Popover from "@web/legacy/js/core/popover"; const { Component } = owl; diff --git a/addons/hr_holidays/static/src/js/float_without_trailing_zeros.js b/addons/hr_holidays/static/src/js/float_without_trailing_zeros.js index a2228d60bcd23..fc8d6578c0204 100644 --- a/addons/hr_holidays/static/src/js/float_without_trailing_zeros.js +++ b/addons/hr_holidays/static/src/js/float_without_trailing_zeros.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import FieldRegistry from 'web.field_registry'; -import basic_fields from 'web.basic_fields'; +import FieldRegistry from '@web/legacy/js/fields/field_registry'; +import basic_fields from '@web/legacy/js/fields/basic_fields'; var FieldFloat = basic_fields.FieldFloat; diff --git a/addons/hr_holidays/static/src/tours/hr_holidays_tour.js b/addons/hr_holidays/static/src/tours/hr_holidays_tour.js index 5046c1cbeb267..49bacd06d05a0 100644 --- a/addons/hr_holidays/static/src/tours/hr_holidays_tour.js +++ b/addons/hr_holidays/static/src/tours/hr_holidays_tour.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import { _t } from 'web.core'; -import "web.legacy_tranlations_loaded"; +import { _t } from "@web/legacy/js/services/core"; +import "@web/legacy/translations_loaded"; import { registry } from "@web/core/registry"; import { stepUtils } from "@web_tour/tour_service/tour_utils"; diff --git a/addons/hr_recruitment/static/src/js/tours/hr_recruitment.js b/addons/hr_recruitment/static/src/js/tours/hr_recruitment.js index 00a6d474448d3..a3bddb854ec7d 100644 --- a/addons/hr_recruitment/static/src/js/tours/hr_recruitment.js +++ b/addons/hr_recruitment/static/src/js/tours/hr_recruitment.js @@ -1,10 +1,10 @@ /** @odoo-module **/ -import {_t} from "web.core"; -import {Markup} from "web.utils"; +import {_t} from "@web/legacy/js/services/core"; +import { Markup } from "@web/legacy/js/core/utils"; import { registry } from "@web/core/registry"; import { stepUtils } from "@web_tour/tour_service/tour_utils"; -import "web.legacy_tranlations_loaded"; +import "@web/legacy/translations_loaded"; const { markup } = owl; diff --git a/addons/iap_mail/static/src/js/services/iap_notification_service.js b/addons/iap_mail/static/src/js/services/iap_notification_service.js index f940d98d533b7..e7fc9c6540847 100644 --- a/addons/iap_mail/static/src/js/services/iap_notification_service.js +++ b/addons/iap_mail/static/src/js/services/iap_notification_service.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import { Markup } from 'web.utils'; +import { Markup } from "@web/legacy/js/core/utils"; import { _t } from "@web/core/l10n/translation"; import { registry } from "@web/core/registry"; diff --git a/addons/im_livechat/static/src/embed/external/session_legacy.js b/addons/im_livechat/static/src/embed/external/session_legacy.js index 38c7112bc461f..ce1bebfff9686 100644 --- a/addons/im_livechat/static/src/embed/external/session_legacy.js +++ b/addons/im_livechat/static/src/embed/external/session_legacy.js @@ -1,6 +1,6 @@ /* @odoo-module alias=web.session */ -import Session from "web.Session"; +import Session from "@web/legacy/js/core/session"; import { serverUrl } from "@im_livechat/embed/livechat_data"; export default new Session(undefined, serverUrl, { use_cors: true }); diff --git a/addons/l10n_ar/static/src/js/tours/account.js b/addons/l10n_ar/static/src/js/tours/account.js index 036b00ece627f..76788c03131bb 100644 --- a/addons/l10n_ar/static/src/js/tours/account.js +++ b/addons/l10n_ar/static/src/js/tours/account.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { patch } from "@web/core/utils/patch"; import { registry } from "@web/core/registry"; -import "account.tour"; +import "@account/js/tours/account"; patch(registry.category("web_tour.tours").get("account_tour"), "patch_account_tour", { steps() { @@ -22,6 +22,6 @@ patch(registry.category("web_tour.tours").get("account_tour"), "patch_account_to auto: true, in_modal: false, }); - return filteredSteps; + return filteredSteps; } }); diff --git a/addons/lunch/static/tests/tours/order_lunch.js b/addons/lunch/static/tests/tours/order_lunch.js index 2622724f3f10b..13ce509d7159b 100644 --- a/addons/lunch/static/tests/tours/order_lunch.js +++ b/addons/lunch/static/tests/tours/order_lunch.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import { _t } from 'web.core'; -import "web.legacy_tranlations_loaded"; +import { _t } from "@web/legacy/js/services/core"; +import "@web/legacy/translations_loaded"; import { registry } from "@web/core/registry"; registry.category("web_tour.tours").add('order_lunch_tour', { diff --git a/addons/mail/static/src/core/web/message_patch.js b/addons/mail/static/src/core/web/message_patch.js index 2adfacf8902d6..2c0440de13225 100644 --- a/addons/mail/static/src/core/web/message_patch.js +++ b/addons/mail/static/src/core/web/message_patch.js @@ -9,8 +9,9 @@ import { _t } from "@web/core/l10n/translation"; import { registry } from "@web/core/registry"; import { useService } from "@web/core/utils/hooks"; import { patch } from "@web/core/utils/patch"; -import { format } from "web.field_utils"; +import fieldUtils from "@web/legacy/js/fields/field_utils"; +const format = fieldUtils.format const formatters = registry.category("formatters"); patch(Message.prototype, "mail/core/web", { diff --git a/addons/mail/static/src/discuss/core/public/boot.js b/addons/mail/static/src/discuss/core/public/boot.js index 82b8d43f1534b..4d772441ea6b8 100644 --- a/addons/mail/static/src/discuss/core/public/boot.js +++ b/addons/mail/static/src/discuss/core/public/boot.js @@ -10,7 +10,7 @@ import { MainComponentsContainer } from "@web/core/main_components_container"; import { registry } from "@web/core/registry"; import { makeEnv, startServices } from "@web/env"; import { mapLegacyEnvToWowlEnv } from "@web/legacy/utils"; -import * as legacyEnv from "web.env"; +import legacyEnv from "@web/legacy/js/env"; Component.env = legacyEnv; diff --git a/addons/mail/static/src/discuss/core/public/root_widget.js b/addons/mail/static/src/discuss/core/public/root_widget.js index d8e940785c017..8ed02ae4045b9 100644 --- a/addons/mail/static/src/discuss/core/public/root_widget.js +++ b/addons/mail/static/src/discuss/core/public/root_widget.js @@ -9,6 +9,6 @@ import "@mail/discuss/core/public/boot"; import { Component } from "@odoo/owl"; -import { standaloneAdapter } from "web.OwlCompatibility"; +import { standaloneAdapter } from "@web/legacy/js/owl_compatibility"; export default standaloneAdapter({ Component }); diff --git a/addons/mail/static/src/discuss/core/web/discuss_tour.js b/addons/mail/static/src/discuss/core/web/discuss_tour.js index dc8e978431ed0..7d637ac1111a3 100644 --- a/addons/mail/static/src/discuss/core/web/discuss_tour.js +++ b/addons/mail/static/src/discuss/core/web/discuss_tour.js @@ -1,9 +1,9 @@ /* @odoo-module */ import { _t } from "@web/core/l10n/translation"; -import "web.legacy_tranlations_loaded"; +import "@web/legacy/translations_loaded"; import { registry } from "@web/core/registry"; -import { Markup } from "web.utils"; +import { Markup } from "@web/legacy/js/core/utils"; registry.category("web_tour.tours").add("mail_tour", { url: "/web#action=mail.action_discuss", diff --git a/addons/mail/static/src/views/web/fields/m2x_avatar_user.js b/addons/mail/static/src/views/web/fields/m2x_avatar_user.js index d08522ece8f35..b498697e57090 100644 --- a/addons/mail/static/src/views/web/fields/m2x_avatar_user.js +++ b/addons/mail/static/src/views/web/fields/m2x_avatar_user.js @@ -1,15 +1,17 @@ /* @odoo-module */ import { _t } from "@web/core/l10n/translation"; -import core from "web.core"; -import fieldRegistry from "web.field_registry"; -import { +import core from "@web/legacy/js/services/core"; +import fieldRegistry from "@web/legacy/js/fields/field_registry"; +import relationalField from "@web/legacy/js/fields/relational_fields"; +import session from "web.session"; + +const { FieldMany2ManyTagsAvatar, KanbanMany2ManyTagsAvatar, ListMany2ManyTagsAvatar, Many2OneAvatar, -} from "web.relational_fields"; -import session from "web.session"; +} = relationalField // This module defines extensions of the Many2OneAvatar and Many2ManyAvatar // widgets, which are integrated with the messaging system. They are designed diff --git a/addons/mail/static/tests/activity/activity_tests.js b/addons/mail/static/tests/activity/activity_tests.js index 338c8af6bbfb7..1455e7bd67548 100644 --- a/addons/mail/static/tests/activity/activity_tests.js +++ b/addons/mail/static/tests/activity/activity_tests.js @@ -9,14 +9,14 @@ import { waitUntil, } from "@mail/../tests/helpers/test_utils"; -import { date_to_str } from "web.time"; +import { date_to_str } from "@web/legacy/js/core/time"; import { mockTimeout, patchDate, patchWithCleanup, triggerHotkey, } from "@web/../tests/helpers/utils"; -import { file } from "web.test_utils"; +import { file } from "@web/../tests/legacy/helpers/test_utils"; const { inputFiles } = file; diff --git a/addons/mail/static/tests/chat_window/chat_window_tests.js b/addons/mail/static/tests/chat_window/chat_window_tests.js index ba5160564a2ec..efda973df1983 100644 --- a/addons/mail/static/tests/chat_window/chat_window_tests.js +++ b/addons/mail/static/tests/chat_window/chat_window_tests.js @@ -20,7 +20,7 @@ import { } from "@mail/../tests/helpers/test_utils"; import { nextTick, triggerEvent, triggerHotkey } from "@web/../tests/helpers/utils"; -import { file } from "web.test_utils"; +import { file } from "@web/../tests/legacy/helpers/test_utils"; const { inputFiles } = file; diff --git a/addons/mail/static/tests/composer/composer_tests.js b/addons/mail/static/tests/composer/composer_tests.js index 7f1445dbc3370..c85dbd4f3d362 100644 --- a/addons/mail/static/tests/composer/composer_tests.js +++ b/addons/mail/static/tests/composer/composer_tests.js @@ -25,7 +25,7 @@ import { triggerEvent, triggerHotkey, } from "@web/../tests/helpers/utils"; -import { file } from "web.test_utils"; +import { file } from "@web/../tests/legacy/helpers/test_utils"; const { inputFiles } = file; diff --git a/addons/mail/static/tests/helpers/mock_server/models/discuss_channel.js b/addons/mail/static/tests/helpers/mock_server/models/discuss_channel.js index 37969b66104ba..c1f5e04ca9e31 100644 --- a/addons/mail/static/tests/helpers/mock_server/models/discuss_channel.js +++ b/addons/mail/static/tests/helpers/mock_server/models/discuss_channel.js @@ -3,7 +3,7 @@ import { patch } from "@web/core/utils/patch"; import { MockServer } from "@web/../tests/helpers/mock_server"; -import { datetime_to_str } from "web.time"; +import { datetime_to_str } from "@web/legacy/js/core/time"; import { assignDefined } from "@mail/utils/common/misc"; import { formatDate } from "@web/core/l10n/dates"; import { Command } from "@mail/../tests/helpers/command"; diff --git a/addons/mail/static/tests/helpers/mock_server/models/mail_thread.js b/addons/mail/static/tests/helpers/mock_server/models/mail_thread.js index b7dfc59df3cac..26359cb187b7d 100644 --- a/addons/mail/static/tests/helpers/mock_server/models/mail_thread.js +++ b/addons/mail/static/tests/helpers/mock_server/models/mail_thread.js @@ -3,7 +3,7 @@ import { patch } from "@web/core/utils/patch"; import { MockServer } from "@web/../tests/helpers/mock_server"; -import { datetime_to_str } from "web.time"; +import { datetime_to_str } from "@web/legacy/js/core/time"; patch(MockServer.prototype, "mail/models/mail_thread", { async _performRPC(route, args) { diff --git a/addons/mail/static/tests/helpers/mock_server/models/res_users.js b/addons/mail/static/tests/helpers/mock_server/models/res_users.js index cd1e803758511..ad75994afe858 100644 --- a/addons/mail/static/tests/helpers/mock_server/models/res_users.js +++ b/addons/mail/static/tests/helpers/mock_server/models/res_users.js @@ -1,7 +1,7 @@ /* @odoo-module */ import { patch } from "@web/core/utils/patch"; -import { date_to_str } from "web.time"; +import { date_to_str } from "@web/legacy/js/core/time"; import { MockServer } from "@web/../tests/helpers/mock_server"; patch(MockServer.prototype, "mail/models/res_users", { diff --git a/addons/mail/static/tests/helpers/patch_ui_size.js b/addons/mail/static/tests/helpers/patch_ui_size.js index 4134ad4209bb9..03f92c9ded4b1 100644 --- a/addons/mail/static/tests/helpers/patch_ui_size.js +++ b/addons/mail/static/tests/helpers/patch_ui_size.js @@ -2,7 +2,7 @@ import { browser } from "@web/core/browser/browser"; import { MEDIAS_BREAKPOINTS, SIZES, utils } from "@web/core/ui/ui_service"; -import config from "web.config"; +import config from "@web/legacy/js/services/config"; import { patchWithCleanup } from "@web/../tests/helpers/utils"; /** diff --git a/addons/mail/static/tests/thread/file_upload_tests.js b/addons/mail/static/tests/thread/file_upload_tests.js index e5b2dc3191776..b1b53f196b10a 100644 --- a/addons/mail/static/tests/thread/file_upload_tests.js +++ b/addons/mail/static/tests/thread/file_upload_tests.js @@ -3,7 +3,7 @@ import { afterNextRender, click, start, startServer } from "@mail/../tests/helpers/test_utils"; import { editInput } from "@web/../tests/helpers/utils"; -import { file } from "web.test_utils"; +import { file } from "@web/../tests/legacy/helpers/test_utils"; const { createFile } = file; diff --git a/addons/mail/static/tests/tours/discuss_public_tour.js b/addons/mail/static/tests/tours/discuss_public_tour.js index bad512548f3b0..d02f0631a79f8 100644 --- a/addons/mail/static/tests/tours/discuss_public_tour.js +++ b/addons/mail/static/tests/tours/discuss_public_tour.js @@ -1,7 +1,7 @@ /* @odoo-module */ import { registry } from "@web/core/registry"; -import { createFile, inputFiles } from "web.test_utils_file"; +import { createFile, inputFiles } from "@web/../tests/legacy/helpers/test_utils_file"; registry.category("web_tour.tours").add("mail/static/tests/tours/discuss_public_tour.js", { test: true, diff --git a/addons/mail/static/tests/tours/mail_full_composer_test_tour.js b/addons/mail/static/tests/tours/mail_full_composer_test_tour.js index 77b668e242bba..38745fcc83556 100644 --- a/addons/mail/static/tests/tours/mail_full_composer_test_tour.js +++ b/addons/mail/static/tests/tours/mail_full_composer_test_tour.js @@ -1,7 +1,7 @@ /* @odoo-module */ import { registry } from "@web/core/registry"; -import { createFile, inputFiles } from "web.test_utils_file"; +import { createFile, inputFiles } from "@web/../tests/legacy/helpers/test_utils_file"; /** * This tour depends on data created by python test in charge of launching it. diff --git a/addons/mail/static/tests/web/chatter_tests.js b/addons/mail/static/tests/web/chatter_tests.js index 781cc919ace5f..c0875f41b35bd 100644 --- a/addons/mail/static/tests/web/chatter_tests.js +++ b/addons/mail/static/tests/web/chatter_tests.js @@ -14,7 +14,7 @@ import { } from "@mail/../tests/helpers/test_utils"; import { editInput, triggerHotkey } from "@web/../tests/helpers/utils"; -import { file } from "web.test_utils"; +import { file } from "@web/../tests/legacy/helpers/test_utils"; const { createFile } = file; diff --git a/addons/mail/static/tests/web/fields/m2x_avatar_user_tests.js b/addons/mail/static/tests/web/fields/m2x_avatar_user_tests.js index 900236ab37b8b..28318d0c926d5 100644 --- a/addons/mail/static/tests/web/fields/m2x_avatar_user_tests.js +++ b/addons/mail/static/tests/web/fields/m2x_avatar_user_tests.js @@ -4,7 +4,7 @@ import { start, startServer } from "@mail/../tests/helpers/test_utils"; import { click, patchWithCleanup, triggerHotkey, triggerEvent } from "@web/../tests/helpers/utils"; import { registry } from "@web/core/registry"; import { session } from "@web/session"; -import { nextTick } from "web.test_utils"; +import { nextTick } from "@web/../tests/legacy/helpers/test_utils"; import { popoverService } from "@web/core/popover/popover_service"; import { tooltipService } from "@web/core/tooltip/tooltip_service"; import { browser } from "@web/core/browser/browser"; diff --git a/addons/mail/static/tests/web/fields/many2many_tags_email_tests.js b/addons/mail/static/tests/web/fields/many2many_tags_email_tests.js index ba129142d6f83..af60c1a241151 100644 --- a/addons/mail/static/tests/web/fields/many2many_tags_email_tests.js +++ b/addons/mail/static/tests/web/fields/many2many_tags_email_tests.js @@ -3,7 +3,7 @@ import { start, startServer } from "@mail/../tests/helpers/test_utils"; import { selectDropdownItem } from "@web/../tests/helpers/utils"; -import testUtils from "web.test_utils"; +import testUtils from "@web/../tests/legacy/helpers/test_utils"; QUnit.module("FieldMany2ManyTagsEmail"); diff --git a/addons/mail/static/tests/web/fields/onchange_on_keydown_tests.js b/addons/mail/static/tests/web/fields/onchange_on_keydown_tests.js index aabe838c58083..eeca0820a6d61 100644 --- a/addons/mail/static/tests/web/fields/onchange_on_keydown_tests.js +++ b/addons/mail/static/tests/web/fields/onchange_on_keydown_tests.js @@ -2,7 +2,7 @@ import { nextTick } from "@web/../tests/helpers/utils"; import { makeView, setupViewRegistries } from "@web/../tests/views/helpers"; -import { dom } from "web.test_utils"; +import { dom } from "@web/../tests/legacy/helpers/test_utils"; let serverData; diff --git a/addons/mail/static/tests/web/follower_list_menu_tests.js b/addons/mail/static/tests/web/follower_list_menu_tests.js index 86f80708e379f..62eed99093003 100644 --- a/addons/mail/static/tests/web/follower_list_menu_tests.js +++ b/addons/mail/static/tests/web/follower_list_menu_tests.js @@ -3,7 +3,7 @@ import { afterNextRender, click, start, startServer } from "@mail/../tests/helpers/test_utils"; import { patchWithCleanup } from "@web/../tests/helpers/utils"; -import { nextTick } from "web.test_utils"; +import { nextTick } from "@web/../tests/legacy/helpers/test_utils"; QUnit.module("follower list menu"); diff --git a/addons/mail_group/static/src/js/mail_group.js b/addons/mail_group/static/src/js/mail_group.js index c04480f4f7f78..37a9a2c15e613 100644 --- a/addons/mail_group/static/src/js/mail_group.js +++ b/addons/mail_group/static/src/js/mail_group.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=mail_group.mail_group **/ +/** @odoo-module **/ -import publicWidget from "web.public.widget"; -import core from "web.core"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import core from "@web/legacy/js/services/core"; const _t = core._t; publicWidget.registry.MailGroup = publicWidget.Widget.extend({ diff --git a/addons/mail_group/static/src/js/mail_group_message.js b/addons/mail_group/static/src/js/mail_group_message.js index f510099f42f2c..47e657b36cf69 100644 --- a/addons/mail_group/static/src/js/mail_group_message.js +++ b/addons/mail_group/static/src/js/mail_group_message.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import publicWidget from "web.public.widget"; +import publicWidget from "@web/legacy/js/public/public_widget"; publicWidget.registry.MailGroupMessage = publicWidget.Widget.extend({ selector: '.o_mg_message', diff --git a/addons/mass_mailing/static/src/js/mailing_m2o_filter.js b/addons/mass_mailing/static/src/js/mailing_m2o_filter.js index 4485dc1c2a46a..01905863c80de 100644 --- a/addons/mass_mailing/static/src/js/mailing_m2o_filter.js +++ b/addons/mass_mailing/static/src/js/mailing_m2o_filter.js @@ -4,7 +4,7 @@ import { registry } from '@web/core/registry'; import { Dropdown } from "@web/core/dropdown/dropdown"; import { useService } from "@web/core/utils/hooks"; import { Many2OneField, many2OneField } from '@web/views/fields/many2one/many2one_field'; -import Domain from 'web.Domain'; +import Domain from '@web/legacy/js/core/domain'; const { useState, useEffect } = owl; @@ -149,7 +149,7 @@ export class FieldMany2OneMailingFilter extends Many2OneField { } } FieldMany2OneMailingFilter.template = 'mass_mailing.MailingFilter'; -FieldMany2OneMailingFilter.components = { +FieldMany2OneMailingFilter.components = { ...Many2OneField.components, MailingFilterDropdown, }; diff --git a/addons/mass_mailing/static/src/js/mailing_portal.js b/addons/mass_mailing/static/src/js/mailing_portal.js index 8ad3aeedd160f..2b0d9b9cf6585 100644 --- a/addons/mass_mailing/static/src/js/mailing_portal.js +++ b/addons/mass_mailing/static/src/js/mailing_portal.js @@ -1,8 +1,8 @@ /** @odoo-module **/ import session from "web.session"; -import ajax from "web.ajax"; -import core from "web.core"; +import ajax from "@web/legacy/js/core/ajax"; +import core from "@web/legacy/js/services/core"; import { sprintf, escape } from "@web/core/utils/strings"; import { whenReady } from "@odoo/owl"; @@ -44,7 +44,7 @@ whenReady(() => { else { $('#div_blacklist').hide(); } - + var unsubscribed_list = $("input[name='unsubscribed_list']").val(); if (unsubscribed_list){ $('#subscription_info').html(sprintf( @@ -56,20 +56,20 @@ whenReady(() => { $('#subscription_info').html(_t('You have been successfully unsubscribed.')); } }); - + $('#unsubscribe_form').on('submit', function (e) { e.preventDefault(); - + var checked_ids = []; $("input[type='checkbox']:checked").each(function (i){ checked_ids[i] = parseInt($(this).val()); }); - + var unchecked_ids = []; $("input[type='checkbox']:not(:checked)").each(function (i){ unchecked_ids[i] = parseInt($(this).val()); }); - + ajax.jsonRpc('/mailing/list/update', 'call', {'opt_in_ids': checked_ids, 'opt_out_ids': unchecked_ids, 'email': email, 'mailing_id': mailing_id, 'res_id': res_id, 'token': token}) .then(function (result) { if (result == 'unauthorized'){ @@ -90,13 +90,13 @@ whenReady(() => { $('#info_state').removeClass('alert-info').addClass('alert-warning'); }); }); - + // ================== // Blacklist // ================== $('#button_add_blacklist').click(function (e) { e.preventDefault(); - + ajax.jsonRpc('/mailing/blacklist/add', 'call', {'email': email, 'mailing_id': mailing_id, 'res_id': res_id, 'token': token}) .then(function (result) { if (result == 'unauthorized'){ @@ -125,10 +125,10 @@ whenReady(() => { $('#info_state').removeClass('alert-success').removeClass('alert-info').removeClass('alert-warning').addClass('alert-error'); }); }); - + $('#button_remove_blacklist').click(function (e) { e.preventDefault(); - + ajax.jsonRpc('/mailing/blacklist/remove', 'call', {'email': email, 'mailing_id': mailing_id, 'res_id': res_id, 'token': token}) .then(function (result) { if (result == 'unauthorized'){ @@ -157,7 +157,7 @@ whenReady(() => { $('#info_state').removeClass('alert-success').removeClass('alert-info').removeClass('alert-warning').addClass('alert-error'); }); }); - + // ================== // Feedback // ================== diff --git a/addons/mass_mailing/static/src/js/mass_mailing_design_constants.js b/addons/mass_mailing/static/src/js/mass_mailing_design_constants.js index cf6fbe0dbf7e9..a1b19e5566eba 100644 --- a/addons/mass_mailing/static/src/js/mass_mailing_design_constants.js +++ b/addons/mass_mailing/static/src/js/mass_mailing_design_constants.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=mass_mailing.design_constants**/ +/** @odoo-module **/ export const CSS_PREFIX = '.o_mail_wrapper'; diff --git a/addons/mass_mailing/static/src/js/mass_mailing_html_field.js b/addons/mass_mailing/static/src/js/mass_mailing_html_field.js index 2acd665e8bbbb..bd344a8be5e07 100644 --- a/addons/mass_mailing/static/src/js/mass_mailing_html_field.js +++ b/addons/mass_mailing/static/src/js/mass_mailing_html_field.js @@ -3,18 +3,19 @@ import { registry } from "@web/core/registry"; import { _lt } from "@web/core/l10n/translation"; import { standardFieldProps } from "@web/views/fields/standard_field_props"; -import { initializeDesignTabCss } from "mass_mailing.design_constants"; -import { toInline, getCSSRules } from "web_editor.convertInline"; +import { initializeDesignTabCss } from "@mass_mailing/js/mass_mailing_design_constants"; +import { toInline, getCSSRules } from "@web_editor/js/backend/convert_inline"; import { getBundle, loadBundle, loadJS } from "@web/core/assets"; -import { qweb } from 'web.core'; +import { qweb } from "@web/legacy/js/services/core"; import { useService } from "@web/core/utils/hooks"; -import { buildQuery } from "web.rpc"; +import { buildQuery } from "@web/legacy/js/core/rpc"; import { HtmlField, htmlField } from "@web_editor/js/backend/html_field"; -import { device } from 'web.config'; +import config from '@web/legacy/js/services/config'; import { MassMailingMobilePreviewDialog } from "./mass_mailing_mobile_preview"; import { getRangePosition } from '@web_editor/js/editor/odoo-editor/src/utils/utils'; import { MassMailingWysiwyg } from '@mass_mailing/js/mass_mailing_wysiwyg'; +const { device } = config const { onWillStart, useSubEnv, diff --git a/addons/mass_mailing/static/src/js/mass_mailing_snippets.js b/addons/mass_mailing/static/src/js/mass_mailing_snippets.js index 71d86dc898004..6cc3fe2c1c5d2 100644 --- a/addons/mass_mailing/static/src/js/mass_mailing_snippets.js +++ b/addons/mass_mailing/static/src/js/mass_mailing_snippets.js @@ -1,14 +1,14 @@ -/** @odoo-module alias=mass_mailing.snippets.options **/ +/** @odoo-module **/ -import options from "web_editor.snippets.options"; +import options from "@web_editor/js/editor/snippets.options"; const SelectUserValueWidget = options.userValueWidgetsRegistry['we-select']; -import weUtils from "web_editor.utils"; +import weUtils from "@web_editor/js/common/utils"; import { CSS_PREFIX, BTN_SIZE_STYLES, DEFAULT_BUTTON_SIZE, PRIORITY_STYLES, FONT_FAMILIES, getFontName, normalizeFontFamily, initializeDesignTabCss, transformFontFamilySelector, -} from "mass_mailing.design_constants"; +} from "@mass_mailing/js/mass_mailing_design_constants"; import { isCSSColor, normalizeCSSColor } from "@web/core/utils/colors"; diff --git a/addons/mass_mailing/static/src/js/mass_mailing_wysiwyg.js b/addons/mass_mailing/static/src/js/mass_mailing_wysiwyg.js index ca7d592a1f623..49e7ea275d80c 100644 --- a/addons/mass_mailing/static/src/js/mass_mailing_wysiwyg.js +++ b/addons/mass_mailing/static/src/js/mass_mailing_wysiwyg.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import { ComponentWrapper } from "web.OwlCompatibility"; +import { ComponentWrapper } from "@web/legacy/js/owl_compatibility"; import { Wysiwyg } from "@web_editor/js/wysiwyg/wysiwyg"; import { closestElement } from "@web_editor/js/editor/odoo-editor/src/OdooEditor"; import { Toolbar } from "@web_editor/js/editor/toolbar"; diff --git a/addons/mass_mailing/static/src/js/snippets.editor.js b/addons/mass_mailing/static/src/js/snippets.editor.js index 3f38973613a55..2711c6feef94e 100644 --- a/addons/mass_mailing/static/src/js/snippets.editor.js +++ b/addons/mass_mailing/static/src/js/snippets.editor.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import {_lt} from "web.core"; -import snippetsEditor from "web_editor.snippet.editor"; +import {_lt} from "@web/legacy/js/services/core"; +import snippetsEditor from "@web_editor/js/editor/snippets.editor"; export const MassMailingSnippetsMenu = snippetsEditor.SnippetsMenu.extend({ events: Object.assign({}, snippetsEditor.SnippetsMenu.prototype.events, { diff --git a/addons/mass_mailing/static/src/js/tours/mass_mailing_tour.js b/addons/mass_mailing/static/src/js/tours/mass_mailing_tour.js index d38d1cd377796..f4265dceb0a4c 100644 --- a/addons/mass_mailing/static/src/js/tours/mass_mailing_tour.js +++ b/addons/mass_mailing/static/src/js/tours/mass_mailing_tour.js @@ -1,10 +1,10 @@ /** @odoo-module **/ - + import { registry } from "@web/core/registry"; import { stepUtils } from "@web_tour/tour_service/tour_utils"; - import {_t} from "web.core"; - import "web.legacy_tranlations_loaded"; - import {Markup} from "web.utils"; + import {_t} from "@web/legacy/js/services/core"; + import "@web/legacy/translations_loaded"; + import { Markup } from "@web/legacy/js/core/utils"; const { DateTime } = luxon; registry.category("web_tour.tours").add('mass_mailing_tour', { diff --git a/addons/mass_mailing/static/src/snippets/s_masonry_block/options.js b/addons/mass_mailing/static/src/snippets/s_masonry_block/options.js index e452683c1780e..f9d5a83076497 100644 --- a/addons/mass_mailing/static/src/snippets/s_masonry_block/options.js +++ b/addons/mass_mailing/static/src/snippets/s_masonry_block/options.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=mass_mailing.masonryOptions **/ +/** @odoo-module **/ -import options from "web_editor.snippets.options"; +import options from "@web_editor/js/editor/snippets.options"; options.registry.MasonryLayout = options.registry.SelectTemplate.extend({ /** diff --git a/addons/mass_mailing/static/src/snippets/s_media_list/options.js b/addons/mass_mailing/static/src/snippets/s_media_list/options.js index fbc89480106fc..66030ae3bbf32 100644 --- a/addons/mass_mailing/static/src/snippets/s_media_list/options.js +++ b/addons/mass_mailing/static/src/snippets/s_media_list/options.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=mass_mailing.s_media_list_options **/ +/** @odoo-module **/ -import options from "web_editor.snippets.options"; +import options from "@web_editor/js/editor/snippets.options"; options.registry.MediaItemLayout = options.Class.extend({ diff --git a/addons/mass_mailing/static/src/snippets/s_rating/options.js b/addons/mass_mailing/static/src/snippets/s_rating/options.js index 583ebc29eda78..bf358cda55379 100644 --- a/addons/mass_mailing/static/src/snippets/s_rating/options.js +++ b/addons/mass_mailing/static/src/snippets/s_rating/options.js @@ -1,8 +1,8 @@ -/** @odoo-module alias=mass_mailing.s_rating_options **/ +/** @odoo-module **/ -import { ComponentWrapper } from "web.OwlCompatibility"; -import { MediaDialogWrapper } from "@web_editor/components/media_dialog/media_dialog_wrapper"; -import options from "web_editor.snippets.options"; +import { ComponentWrapper } from "@web/legacy/js/owl_compatibility"; +import { MediaDialogWrapper } from "@web_editor/components/media_dialog/media_dialog"; +import options from "@web_editor/js/editor/snippets.options"; options.registry.Rating = options.Class.extend({ /** diff --git a/addons/mass_mailing/static/src/snippets/s_showcase/options.js b/addons/mass_mailing/static/src/snippets/s_showcase/options.js index ff127b318502c..296ad494d2e3e 100644 --- a/addons/mass_mailing/static/src/snippets/s_showcase/options.js +++ b/addons/mass_mailing/static/src/snippets/s_showcase/options.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=mass_mailing.s_showcase_options **/ +/** @odoo-module **/ -import options from "web_editor.snippets.options"; +import options from "@web_editor/js/editor/snippets.options"; options.registry.Showcase = options.Class.extend({ /** diff --git a/addons/mass_mailing/static/tests/mass_mailing_favourite_filter_tests.js b/addons/mass_mailing/static/tests/mass_mailing_favourite_filter_tests.js index d4ae7931bad49..dac6570088c43 100644 --- a/addons/mass_mailing/static/tests/mass_mailing_favourite_filter_tests.js +++ b/addons/mass_mailing/static/tests/mass_mailing_favourite_filter_tests.js @@ -1,8 +1,8 @@ -/** @odoo-module alias=mass_mailing.FieldMassMailingFavoriteFilter.test */ +/** @odoo-module */ import { makeView, setupViewRegistries } from "@web/../tests/views/helpers"; import * as testUtils from "@web/../tests/helpers/utils"; -import weTestUtils from "web_editor.test_utils"; +import weTestUtils from "@web_editor/../tests/test_utils"; let fixture; let serverData; diff --git a/addons/mass_mailing/static/tests/mass_mailing_html_tests.js b/addons/mass_mailing/static/tests/mass_mailing_html_tests.js index 04b1f4d899256..4a52703436bde 100644 --- a/addons/mass_mailing/static/tests/mass_mailing_html_tests.js +++ b/addons/mass_mailing/static/tests/mass_mailing_html_tests.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=mass_mailing.field_html_tests **/ +/** @odoo-module **/ -import weTestUtils from "web_editor.test_utils"; +import weTestUtils from "@web_editor/../tests/test_utils"; import { makeView, setupViewRegistries } from "@web/../tests/views/helpers"; import { editInput, @@ -9,7 +9,7 @@ import { nextTick, patchWithCleanup, } from "@web/../tests/helpers/utils"; -import * as legacyTestUtils from "web.test_utils"; +import * as legacyTestUtils from "@web/../tests/legacy/helpers/test_utils"; import { assets } from "@web/core/assets"; import { Wysiwyg } from '@web_editor/js/wysiwyg/wysiwyg'; diff --git a/addons/mrp/static/tests/mrp_document_kanban_tests.js b/addons/mrp/static/tests/mrp_document_kanban_tests.js index 10de8f1755c6a..6260c32760ef2 100644 --- a/addons/mrp/static/tests/mrp_document_kanban_tests.js +++ b/addons/mrp/static/tests/mrp_document_kanban_tests.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import testUtils from 'web.test_utils'; +import testUtils from '@web/../tests/legacy/helpers/test_utils'; import { registry } from "@web/core/registry"; import { click, @@ -192,7 +192,7 @@ QUnit.module('MrpDocumentsKanbanView', { "Uploading... (50%)", "the current upload progress should be at 50%" ); - + progressEvent.loaded = 350000000; mockedXHRs[0].upload.dispatchEvent(progressEvent); await nextTick(); diff --git a/addons/payment/static/src/js/checkout_form.js b/addons/payment/static/src/js/checkout_form.js index 51b17b4777beb..8a862e386257c 100644 --- a/addons/payment/static/src/js/checkout_form.js +++ b/addons/payment/static/src/js/checkout_form.js @@ -1,8 +1,8 @@ -/** @odoo-module alias=payment.checkout_form **/ - - import publicWidget from "web.public.widget"; +/** @odoo-module **/ - import paymentFormMixin from "payment.payment_form_mixin"; + import publicWidget from "@web/legacy/js/public/public_widget"; + + import paymentFormMixin from "@payment/js/payment_form_mixin"; import { debounce } from "@web/core/utils/timing"; publicWidget.registry.PaymentCheckoutForm = publicWidget.Widget.extend(paymentFormMixin, { diff --git a/addons/payment/static/src/js/express_checkout_form.js b/addons/payment/static/src/js/express_checkout_form.js index 8db86628b564e..c0138af95c325 100644 --- a/addons/payment/static/src/js/express_checkout_form.js +++ b/addons/payment/static/src/js/express_checkout_form.js @@ -1,7 +1,7 @@ /** @odoo-module */ -import core from 'web.core'; -import publicWidget from 'web.public.widget'; +import core from "@web/legacy/js/services/core"; +import publicWidget from '@web/legacy/js/public/public_widget'; publicWidget.registry.PaymentExpressCheckoutForm = publicWidget.Widget.extend({ selector: 'form[name="o_payment_express_checkout_form"]', diff --git a/addons/payment/static/src/js/manage_form.js b/addons/payment/static/src/js/manage_form.js index 9544bf30da1dd..3835b5dc2449f 100644 --- a/addons/payment/static/src/js/manage_form.js +++ b/addons/payment/static/src/js/manage_form.js @@ -1,10 +1,10 @@ -/** @odoo-module alias=payment.manage_form **/ - - import core from "web.core"; - import publicWidget from "web.public.widget"; - import Dialog from "web.Dialog"; +/** @odoo-module **/ - import paymentFormMixin from "payment.payment_form_mixin"; + import core from "@web/legacy/js/services/core"; + import publicWidget from "@web/legacy/js/public/public_widget"; + import Dialog from "@web/legacy/js/core/dialog"; + + import paymentFormMixin from "@payment/js/payment_form_mixin"; import { debounce } from "@web/core/utils/timing"; const _t = core._t; diff --git a/addons/payment/static/src/js/payment_form_mixin.js b/addons/payment/static/src/js/payment_form_mixin.js index fae686c1aa932..571754b2e4081 100644 --- a/addons/payment/static/src/js/payment_form_mixin.js +++ b/addons/payment/static/src/js/payment_form_mixin.js @@ -1,8 +1,8 @@ -/** @odoo-module alias=payment.payment_form_mixin **/ +/** @odoo-module **/ import { escape, sprintf } from "@web/core/utils/strings"; - import core from "web.core"; - import Dialog from "web.Dialog"; + import core from "@web/legacy/js/services/core"; + import Dialog from "@web/legacy/js/core/dialog"; const _t = core._t; diff --git a/addons/payment/static/src/js/post_processing.js b/addons/payment/static/src/js/post_processing.js index 4832227a3604a..2a63e320a7193 100644 --- a/addons/payment/static/src/js/post_processing.js +++ b/addons/payment/static/src/js/post_processing.js @@ -1,8 +1,8 @@ -/** @odoo-module alias=payment.post_processing **/ - - import publicWidget from "web.public.widget"; - import core from "web.core"; - import {Markup} from "web.utils"; +/** @odoo-module **/ + + import publicWidget from "@web/legacy/js/public/public_widget"; + import core from "@web/legacy/js/services/core"; + import { Markup } from "@web/legacy/js/core/utils"; var _t = core._t; @@ -94,12 +94,12 @@ } return nbTx; } - + /* - * When the server sends the list of monitored transactions, it tries to post-process - * all the successful ones. If it succeeds or if the post-process has already been made, - * the transaction is removed from the list of monitored transactions and won't be - * included in the next response. We assume that successful and post-process + * When the server sends the list of monitored transactions, it tries to post-process + * all the successful ones. If it succeeds or if the post-process has already been made, + * the transaction is removed from the list of monitored transactions and won't be + * included in the next response. We assume that successful and post-process * transactions should always prevail on others, regardless of their number or state. */ if (render_values['tx_done'].length === 1 && diff --git a/addons/payment_adyen/static/src/js/payment_form.js b/addons/payment_adyen/static/src/js/payment_form.js index fa5f177ba7033..6f11c46aaac53 100644 --- a/addons/payment_adyen/static/src/js/payment_form.js +++ b/addons/payment_adyen/static/src/js/payment_form.js @@ -1,9 +1,9 @@ /** @odoo-module **/ /* global AdyenCheckout */ - - import core from "web.core"; - import checkoutForm from "payment.checkout_form"; - import manageForm from "payment.manage_form"; + + import core from "@web/legacy/js/services/core"; + import checkoutForm from "@payment/js/checkout_form"; + import manageForm from "@payment/js/manage_form"; const _t = core._t; @@ -115,7 +115,7 @@ /** * Prepare the inline form of Adyen for direct payment. * - * @override method from payment.payment_form_mixin + * @override method from @payment/js/payment_form_mixin * @private * @param {string} code - The code of the selected payment option's provider * @param {number} paymentOptionId - The id of the selected payment option @@ -195,7 +195,7 @@ /** * Trigger the payment processing by submitting the drop-in. * - * @override method from payment.payment_form_mixin + * @override method from @payment/js/payment_form_mixin * @private * @param {string} provider - The provider of the payment option's provider * @param {number} paymentOptionId - The id of the payment option handling the transaction diff --git a/addons/payment_authorize/static/src/js/payment_form.js b/addons/payment_authorize/static/src/js/payment_form.js index b65b9c8f4e3c5..199340a8a8aed 100644 --- a/addons/payment_authorize/static/src/js/payment_form.js +++ b/addons/payment_authorize/static/src/js/payment_form.js @@ -1,11 +1,11 @@ /** @odoo-module **/ /* global Accept */ - - import core from "web.core"; + + import core from "@web/legacy/js/services/core"; import { loadJS } from "@web/core/assets"; - import checkoutForm from "payment.checkout_form"; - import manageForm from "payment.manage_form"; + import checkoutForm from "@payment/js/checkout_form"; + import manageForm from "@payment/js/manage_form"; const _t = core._t; @@ -71,7 +71,7 @@ /** * Prepare the inline form of Authorize.Net for direct payment. * - * @override method from payment.payment_form_mixin + * @override method from @payment/js/payment_form_mixin * @private * @param {string} provider - The provider of the selected payment option's provider * @param {number} paymentOptionId - The id of the selected payment option @@ -115,7 +115,7 @@ /** * Dispatch the secure data to Authorize.Net. * - * @override method from payment.payment_form_mixin + * @override method from @payment/js/payment_form_mixin * @private * @param {string} code - The code of the payment option's provider * @param {number} paymentOptionId - The id of the payment option handling the transaction diff --git a/addons/payment_custom/static/src/js/post_processing.js b/addons/payment_custom/static/src/js/post_processing.js index b95d9af1a137e..5f50304e34856 100644 --- a/addons/payment_custom/static/src/js/post_processing.js +++ b/addons/payment_custom/static/src/js/post_processing.js @@ -1,13 +1,13 @@ /** @odoo-module **/ - - import paymentPostProcessing from "payment.post_processing"; + + import paymentPostProcessing from "@payment/js/post_processing"; paymentPostProcessing.include({ /** * Don't wait for the transaction to be confirmed before redirecting customers to the * landing route because custom transactions remain in the state 'pending' forever. * - * @override method from `payment.post_processing` + * @override method from `@payment/js/post_processing` * @param {Object} display_values_list - The post-processing values of the transactions */ processPolledData: function (display_values_list) { diff --git a/addons/payment_demo/static/src/js/payment_form.js b/addons/payment_demo/static/src/js/payment_form.js index 32993fc90c238..843c406f6cdce 100644 --- a/addons/payment_demo/static/src/js/payment_form.js +++ b/addons/payment_demo/static/src/js/payment_form.js @@ -1,7 +1,7 @@ /** @odoo-module **/ - - import checkoutForm from "payment.checkout_form"; - import manageForm from "payment.manage_form"; + + import checkoutForm from "@payment/js/checkout_form"; + import manageForm from "@payment/js/manage_form"; const paymentDemoMixin = { @@ -12,7 +12,7 @@ /** * Simulate a feedback from a payment provider and redirect the customer to the status page. * - * @override method from payment.payment_form_mixin + * @override method from @payment/js/payment_form_mixin * @private * @param {string} code - The code of the provider * @param {number} providerId - The id of the provider handling the transaction @@ -41,7 +41,7 @@ /** * Prepare the inline form of Demo for direct payment. * - * @override method from payment.payment_form_mixin + * @override method from @payment/js/payment_form_mixin * @private * @param {string} code - The code of the selected payment option's provider * @param {integer} paymentOptionId - The id of the selected payment option diff --git a/addons/payment_stripe/static/src/js/checkout_form.js b/addons/payment_stripe/static/src/js/checkout_form.js index fa88716e108cd..a4cc951c892a0 100644 --- a/addons/payment_stripe/static/src/js/checkout_form.js +++ b/addons/payment_stripe/static/src/js/checkout_form.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import checkoutForm from 'payment.checkout_form'; +import checkoutForm from "@payment/js/checkout_form"; import stripeMixin from '@payment_stripe/js/stripe_mixin'; checkoutForm.include(stripeMixin); diff --git a/addons/payment_stripe/static/src/js/manage_form.js b/addons/payment_stripe/static/src/js/manage_form.js index 5a4f8864b0055..e6b240452716c 100644 --- a/addons/payment_stripe/static/src/js/manage_form.js +++ b/addons/payment_stripe/static/src/js/manage_form.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import manageForm from 'payment.manage_form'; +import manageForm from "@payment/js/manage_form"; import stripeMixin from '@payment_stripe/js/stripe_mixin'; manageForm.include(stripeMixin); diff --git a/addons/payment_stripe/static/src/js/stripe_mixin.js b/addons/payment_stripe/static/src/js/stripe_mixin.js index d1665cc656747..2ca501368f85f 100644 --- a/addons/payment_stripe/static/src/js/stripe_mixin.js +++ b/addons/payment_stripe/static/src/js/stripe_mixin.js @@ -1,7 +1,7 @@ /** @odoo-module */ /* global Stripe */ -import core from 'web.core'; +import core from "@web/legacy/js/services/core"; import { StripeOptions } from '@payment_stripe/js/stripe_options'; const _t = core._t; diff --git a/addons/point_of_sale/static/src/backend/tours/point_of_sale.js b/addons/point_of_sale/static/src/backend/tours/point_of_sale.js index f163bfa8045a3..bdf83b58c7c0c 100644 --- a/addons/point_of_sale/static/src/backend/tours/point_of_sale.js +++ b/addons/point_of_sale/static/src/backend/tours/point_of_sale.js @@ -4,7 +4,7 @@ import { _t } from "@web/core/l10n/translation"; import { markup } from "@odoo/owl"; import { registry } from "@web/core/registry"; import { stepUtils } from "@web_tour/tour_service/tour_utils"; -import "web.legacy_tranlations_loaded"; +import "@web/legacy/translations_loaded"; registry.category("web_tour.tours").add("point_of_sale_tour", { url: "/web", diff --git a/addons/point_of_sale/static/tests/unit/number_buffer_service_tests.js b/addons/point_of_sale/static/tests/unit/number_buffer_service_tests.js index faec50eb6cd84..fda3c9c5287a3 100644 --- a/addons/point_of_sale/static/tests/unit/number_buffer_service_tests.js +++ b/addons/point_of_sale/static/tests/unit/number_buffer_service_tests.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import testUtils from "web.test_utils"; +import testUtils from "@web/../tests/legacy/helpers/test_utils"; import { makeTestEnv } from "@web/../tests/helpers/mock_env"; import { getFixture, mount } from "@web/../tests/helpers/utils"; import { useService } from "@web/core/utils/hooks"; diff --git a/addons/point_of_sale/static/tests/unit/popup_controller_tests.js b/addons/point_of_sale/static/tests/unit/popup_controller_tests.js index 30295e40be2e5..58fffa074e418 100644 --- a/addons/point_of_sale/static/tests/unit/popup_controller_tests.js +++ b/addons/point_of_sale/static/tests/unit/popup_controller_tests.js @@ -1,7 +1,7 @@ /** @odoo-module */ import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup"; -import makeTestEnvironment from "web.test_env"; +import makeTestEnvironment from "@web/../tests/legacy/helpers/test_env"; import { click, getFixture, mount, nextTick, triggerEvent } from "@web/../tests/helpers/utils"; import { clearRegistryWithCleanup, makeTestEnv } from "@web/../tests/helpers/mock_env"; import { registry } from "@web/core/registry"; diff --git a/addons/portal/static/src/js/portal.js b/addons/portal/static/src/js/portal.js index 7efa4580800ca..d7004259e245d 100644 --- a/addons/portal/static/src/js/portal.js +++ b/addons/portal/static/src/js/portal.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=portal.portal **/ +/** @odoo-module **/ -import publicWidget from "web.public.widget"; +import publicWidget from "@web/legacy/js/public/public_widget"; publicWidget.registry.portalDetails = publicWidget.Widget.extend({ selector: '.o_portal_details', @@ -49,7 +49,7 @@ publicWidget.registry.portalDetails = publicWidget.Widget.extend({ }, }); -publicWidget.registry.PortalHomeCounters = publicWidget.Widget.extend({ +export const PortalHomeCounters = publicWidget.Widget.extend({ selector: '.o_portal_my_home', /** @@ -113,6 +113,8 @@ publicWidget.registry.PortalHomeCounters = publicWidget.Widget.extend({ }, }); +publicWidget.registry.PortalHomeCounters = PortalHomeCounters; + publicWidget.registry.portalSearchPanel = publicWidget.Widget.extend({ selector: '.o_portal_search_panel', events: { diff --git a/addons/portal/static/src/js/portal_chatter.js b/addons/portal/static/src/js/portal_chatter.js index 169f151ba995a..13ef4d96026b3 100644 --- a/addons/portal/static/src/js/portal_chatter.js +++ b/addons/portal/static/src/js/portal_chatter.js @@ -1,10 +1,10 @@ -/** @odoo-module alias=portal.chatter **/ +/** @odoo-module **/ -import core from "web.core"; -import dom from "web.dom"; -import publicWidget from "web.public.widget"; -import portalComposer from "portal.composer"; -import {Markup} from "web.utils"; +import core from "@web/legacy/js/services/core"; +import dom from "@web/legacy/js/core/dom"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import portalComposer from "@portal/js/portal_composer"; +import { Markup } from "@web/legacy/js/core/utils"; import { range } from "@web/core/utils/numbers"; var qweb = core.qweb; @@ -337,6 +337,4 @@ publicWidget.registry.portalChatter = publicWidget.Widget.extend({ }, }); -export default { - PortalChatter: PortalChatter, -}; +export default PortalChatter diff --git a/addons/portal/static/src/js/portal_composer.js b/addons/portal/static/src/js/portal_composer.js index 31efbfef6a51e..3c2d6d33c22a6 100644 --- a/addons/portal/static/src/js/portal_composer.js +++ b/addons/portal/static/src/js/portal_composer.js @@ -1,9 +1,9 @@ -/** @odoo-module alias=portal.composer **/ +/** @odoo-module **/ import { escape, sprintf } from "@web/core/utils/strings"; -import ajax from "web.ajax"; -import core from "web.core"; -import publicWidget from "web.public.widget"; +import ajax from "@web/legacy/js/core/ajax"; +import core from "@web/legacy/js/services/core"; +import publicWidget from "@web/legacy/js/public/public_widget"; var qweb = core.qweb; var _t = core._t; diff --git a/addons/portal/static/src/js/portal_security.js b/addons/portal/static/src/js/portal_security.js index 6c1de4babd0ba..dc6fb5946d715 100644 --- a/addons/portal/static/src/js/portal_security.js +++ b/addons/portal/static/src/js/portal_security.js @@ -1,8 +1,8 @@ -/** @odoo-module alias=portal.security **/ +/** @odoo-module **/ -import publicWidget from "web.public.widget"; -import Dialog from "web.Dialog"; -import {_t, qweb} from "web.core"; +import publicWidget from '@web/legacy/js/public/public_widget'; +import Dialog from "@web/legacy/js/core/dialog"; +import {_t, qweb} from "@web/legacy/js/services/core"; import session from "web.session"; publicWidget.registry.NewAPIKeyButton = publicWidget.Widget.extend({ @@ -110,7 +110,7 @@ publicWidget.registry.portalSecurity = publicWidget.Widget.extend({ }); /** - * Defining what happens when you click the "Log out from all devices" + * Defining what happens when you click the "Log out from all devices" * on the "/my/security" page. */ publicWidget.registry.RevokeSessionsButton = publicWidget.Widget.extend({ @@ -167,7 +167,7 @@ publicWidget.registry.RevokeSessionsButton = publicWidget.Widget.extend({ } }, { text: _t('Cancel'), close: true - }] + }] }); dialog.opened(() => { const password_input = dialog.el.querySelector('[name="password"]'); @@ -201,7 +201,7 @@ publicWidget.registry.RevokeSessionsButton = publicWidget.Widget.extend({ * @param {Promise} wrapped promise to check for an identity check request * @returns {Promise} result of the original call */ -function handleCheckIdentity(rpc, wrapped) { +export function handleCheckIdentity(rpc, wrapped) { return wrapped.then((r) => { if (!(r.type === "ir.actions.act_window" && r.res_model === "res.users.identitycheck")) { return r; @@ -261,6 +261,3 @@ function handleCheckIdentity(rpc, wrapped) { }); }); } -export default { - handleCheckIdentity, -} diff --git a/addons/portal/static/src/js/portal_sidebar.js b/addons/portal/static/src/js/portal_sidebar.js index e23ff16799797..fe42048a6f7b4 100644 --- a/addons/portal/static/src/js/portal_sidebar.js +++ b/addons/portal/static/src/js/portal_sidebar.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=portal.PortalSidebar **/ +/** @odoo-module **/ -import core from "web.core"; -import publicWidget from "web.public.widget"; +import core from "@web/legacy/js/services/core"; +import publicWidget from "@web/legacy/js/public/public_widget"; import session from "web.session"; import { sprintf } from "@web/core/utils/strings"; import { deserializeDateTime } from "@web/core/l10n/dates"; diff --git a/addons/portal/static/src/js/portal_signature.js b/addons/portal/static/src/js/portal_signature.js index 695e98d72a7a9..3bf591b48c314 100644 --- a/addons/portal/static/src/js/portal_signature.js +++ b/addons/portal/static/src/js/portal_signature.js @@ -1,8 +1,8 @@ -/** @odoo-module alias=portal.signature_form **/ +/** @odoo-module **/ -import core from "web.core"; -import publicWidget from "web.public.widget"; -import { NameAndSignature } from "web.name_and_signature"; +import core from "@web/legacy/js/services/core"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import { NameAndSignature } from "@web/legacy/js/widgets/name_and_signature"; var qweb = core.qweb; var _t = core._t; @@ -189,6 +189,4 @@ publicWidget.registry.SignatureForm = publicWidget.Widget.extend({ }, }); -export default { - SignatureForm: SignatureForm, -}; +export default SignatureForm; diff --git a/addons/portal_rating/static/src/js/portal_chatter.js b/addons/portal_rating/static/src/js/portal_chatter.js index 15c3037a6b404..50b73b0cedffe 100644 --- a/addons/portal_rating/static/src/js/portal_chatter.js +++ b/addons/portal_rating/static/src/js/portal_chatter.js @@ -1,11 +1,10 @@ /** @odoo-module **/ -import core from "web.core"; -import portalChatter from "portal.chatter"; +import core from "@web/legacy/js/services/core"; +import PortalChatter from "@portal/js/portal_chatter"; import { roundPrecision } from "@web/core/utils/numbers"; var _t = core._t; -var PortalChatter = portalChatter.PortalChatter; var qweb = core.qweb; /** @@ -168,7 +167,7 @@ PortalChatter.include({ /** * Default rating data for publisher comment qweb template * @private - * @param {Integer} messageIndex + * @param {Integer} messageIndex */ _newPublisherCommentData: function (messageIndex) { return { @@ -179,12 +178,12 @@ PortalChatter.include({ publisher_datetime: '', publisher_comment: '', }; - }, + }, /** * preprocess the rating data comming from /website/rating/comment or the chatter_init * Can be also use to have new rating data for a new publisher comment - * @param {JSON} rawRating + * @param {JSON} rawRating * @returns {JSON} the process rating data */ _preprocessCommentData: function (rawRating, messageIndex) { @@ -276,9 +275,9 @@ PortalChatter.include({ return; } var messageIndex = $source.data("mes_index"); - var data = {is_publisher: this.options['is_user_publisher']}; + var data = {is_publisher: this.options['is_user_publisher']}; data.rating = this._newPublisherCommentData(messageIndex); - + var oldRating = this.messages[messageIndex].rating; data.rating.publisher_comment = oldRating.publisher_comment ? oldRating.publisher_comment : ''; this._getCommentContainer($source).html($(qweb.render("portal_rating.chatter_rating_publisher_form", data))); @@ -307,7 +306,7 @@ PortalChatter.include({ self._getCommentButton($source).removeClass("d-none"); self._getCommentContainer($source).empty(); }); - }, + }, /** * @private @@ -334,14 +333,14 @@ PortalChatter.include({ if (self.messages[messageIndex].rating.publisher_comment !== '') { // Remove the button comment if exist and render the comment self._getCommentButton($source).addClass('d-none'); - self._getCommentContainer($source).html($(qweb.render("portal_rating.chatter_rating_publisher_comment", { + self._getCommentContainer($source).html($(qweb.render("portal_rating.chatter_rating_publisher_comment", { rating: self.messages[messageIndex].rating, is_publisher: self.options.is_user_publisher }))); } else { // Empty string or false considers as no comment self._getCommentButton($source).removeClass("d-none"); - self._getCommentContainer($source).empty(); + self._getCommentContainer($source).empty(); } }); }, diff --git a/addons/portal_rating/static/src/js/portal_composer.js b/addons/portal_rating/static/src/js/portal_composer.js index 91f6795aeaa6c..408eedec9531a 100644 --- a/addons/portal_rating/static/src/js/portal_composer.js +++ b/addons/portal_rating/static/src/js/portal_composer.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import core from "web.core"; -import portalComposer from "portal.composer"; +import core from "@web/legacy/js/services/core"; +import portalComposer from "@portal/js/portal_composer"; var _t = core._t; @@ -67,7 +67,7 @@ PortalComposer.include({ } // set the default value to trigger the display of star widget and update the hidden input value. - self.set("star_value", self.options.default_rating_value); + self.set("star_value", self.options.default_rating_value); self.$input.val(self.options.default_rating_value); }); }, diff --git a/addons/portal_rating/static/src/js/portal_rating_composer.js b/addons/portal_rating/static/src/js/portal_rating_composer.js index 5046f5ab44bd8..72b8703860ebf 100644 --- a/addons/portal_rating/static/src/js/portal_rating_composer.js +++ b/addons/portal_rating/static/src/js/portal_rating_composer.js @@ -1,9 +1,9 @@ -/** @odoo-module alias=portal.rating.composer **/ +/** @odoo-module **/ -import publicWidget from "web.public.widget"; +import publicWidget from "@web/legacy/js/public/public_widget"; import session from "web.session"; -import portalComposer from "portal.composer"; -import {_t, qweb} from "web.core"; +import portalComposer from "@portal/js/portal_composer"; +import {_t, qweb} from "@web/legacy/js/services/core"; const PortalComposer = portalComposer.PortalComposer; diff --git a/addons/pos_hr_restaurant/static/src/overrides/models/pos_store.js b/addons/pos_hr_restaurant/static/src/overrides/models/pos_store.js index 070a184a682f6..b146d0a5a14e1 100644 --- a/addons/pos_hr_restaurant/static/src/overrides/models/pos_store.js +++ b/addons/pos_hr_restaurant/static/src/overrides/models/pos_store.js @@ -1,4 +1,4 @@ -/* @odoo-module alias=pos_restaurant_hr.chrome */ +/* @odoo-module */ import { patch } from "@web/core/utils/patch"; import "@pos_restaurant/overrides/models/pos_store"; diff --git a/addons/pos_loyalty/static/src/overrides/models/loyalty.js b/addons/pos_loyalty/static/src/overrides/models/loyalty.js index 19b2472978c88..06b26480e0a80 100644 --- a/addons/pos_loyalty/static/src/overrides/models/loyalty.js +++ b/addons/pos_loyalty/static/src/overrides/models/loyalty.js @@ -2,7 +2,7 @@ import { Order, Orderline } from "@point_of_sale/app/store/models"; import { Mutex } from "@web/core/utils/concurrency"; -import concurrency from "web.concurrency"; +import concurrency from "@web/legacy/js/core/concurrency"; import { roundDecimals, roundPrecision } from "@web/core/utils/numbers"; import { _t } from "@web/core/l10n/translation"; import { patch } from "@web/core/utils/patch"; diff --git a/addons/pos_sale_loyalty/static/src/overrides/models/models.js b/addons/pos_sale_loyalty/static/src/overrides/models/models.js index 78d741a48dfcf..dc6e7f370e4df 100644 --- a/addons/pos_sale_loyalty/static/src/overrides/models/models.js +++ b/addons/pos_sale_loyalty/static/src/overrides/models/models.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=pos_sale_loyalty.models **/ +/** @odoo-module **/ import { Orderline } from "@point_of_sale/app/store/models"; diff --git a/addons/project/static/src/js/portal_rating.js b/addons/project/static/src/js/portal_rating.js index 55b28cc6a87e3..9c65101cd2d85 100644 --- a/addons/project/static/src/js/portal_rating.js +++ b/addons/project/static/src/js/portal_rating.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import time from 'web.time'; -import publicWidget from 'web.public.widget'; +import time from '@web/legacy/js/core/time'; +import publicWidget from '@web/legacy/js/public/public_widget'; publicWidget.registry.ProjectRatingImage = publicWidget.Widget.extend({ selector: '.o_portal_project_rating .o_rating_image', diff --git a/addons/project/static/src/js/tours/project.js b/addons/project/static/src/js/tours/project.js index 5205b2179dd19..bac72ab3cee17 100644 --- a/addons/project/static/src/js/tours/project.js +++ b/addons/project/static/src/js/tours/project.js @@ -1,10 +1,10 @@ /** @odoo-module **/ -import {_t} from "web.core"; -import {Markup} from "web.utils"; +import {_t} from "@web/legacy/js/services/core"; +import { Markup } from "@web/legacy/js/core/utils"; import { registry } from "@web/core/registry"; import { stepUtils } from "@web_tour/tour_service/tour_utils"; -import "web.legacy_tranlations_loaded"; +import "@web/legacy/translations_loaded"; registry.category("web_tour.tours").add('project_tour', { sequence: 110, diff --git a/addons/project_todo/static/tests/helpers/mock_server/controller/project_todo.js b/addons/project_todo/static/tests/helpers/mock_server/controller/project_todo.js index 8d622de50c680..de46740ed687c 100644 --- a/addons/project_todo/static/tests/helpers/mock_server/controller/project_todo.js +++ b/addons/project_todo/static/tests/helpers/mock_server/controller/project_todo.js @@ -3,7 +3,7 @@ import { patch } from '@web/core/utils/patch'; import { MockServer } from '@web/../tests/helpers/mock_server'; -import { date_to_str } from 'web.time'; +import { date_to_str } from '@web/legacy/js/core/time'; patch(MockServer.prototype, 'project_todo/controller/project_todo', { //-------------------------------------------------------------------------- diff --git a/addons/purchase/static/src/js/purchase_portal_sidebar.js b/addons/purchase/static/src/js/purchase_portal_sidebar.js index 255fac9802bcf..30ae299a09c35 100644 --- a/addons/purchase/static/src/js/purchase_portal_sidebar.js +++ b/addons/purchase/static/src/js/purchase_portal_sidebar.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import publicWidget from "web.public.widget"; -import PortalSidebar from "portal.PortalSidebar"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import PortalSidebar from "@portal/js/portal_sidebar"; import { uniqueId } from "@web/core/utils/functions"; publicWidget.registry.PurchasePortalSidebar = PortalSidebar.extend({ diff --git a/addons/purchase/static/src/js/tours/purchase.js b/addons/purchase/static/src/js/tours/purchase.js index 9a4bc8b7d37b1..3567f442bf6f5 100644 --- a/addons/purchase/static/src/js/tours/purchase.js +++ b/addons/purchase/static/src/js/tours/purchase.js @@ -1,12 +1,12 @@ /** @odoo-module **/ -import core from "web.core"; +import core from "@web/legacy/js/services/core"; import { registry } from "@web/core/registry"; import { stepUtils } from "@web_tour/tour_service/tour_utils"; -import "web.legacy_tranlations_loaded"; +import "@web/legacy/translations_loaded"; var _t = core._t; -import PurchaseAdditionalTourSteps from "purchase.purchase_steps"; +import PurchaseAdditionalTourSteps from "@purchase/js/tours/purchase_steps"; registry.category("web_tour.tours").add('purchase_tour' , { url: "/web", diff --git a/addons/purchase/static/src/js/tours/purchase_steps.js b/addons/purchase/static/src/js/tours/purchase_steps.js index 6cfcf60d4b150..d7387e977da0e 100644 --- a/addons/purchase/static/src/js/tours/purchase_steps.js +++ b/addons/purchase/static/src/js/tours/purchase_steps.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=purchase.purchase_steps **/ +/** @odoo-module **/ -import core from "web.core"; +import core from "@web/legacy/js/services/core"; var PurchaseAdditionalTourSteps = core.Class.extend({ _get_purchase_stock_steps: function () { diff --git a/addons/purchase_stock/static/src/js/tours/purchase_stock.js b/addons/purchase_stock/static/src/js/tours/purchase_stock.js index e5b448d02830a..c96504f949274 100644 --- a/addons/purchase_stock/static/src/js/tours/purchase_stock.js +++ b/addons/purchase_stock/static/src/js/tours/purchase_stock.js @@ -1,10 +1,10 @@ -/** @odoo-module alias=purchase_stock.purchase_steps **/ +/** @odoo-module **/ -import core from "web.core"; -import "web.legacy_tranlations_loaded"; +import core from "@web/legacy/js/services/core"; +import "@web/legacy/translations_loaded"; var _t = core._t; -import PurchaseAdditionalTourSteps from "purchase.purchase_steps"; +import PurchaseAdditionalTourSteps from "@purchase/js/tours/purchase_steps"; PurchaseAdditionalTourSteps.include({ diff --git a/addons/sale/static/src/js/payment_form.js b/addons/sale/static/src/js/payment_form.js index 06a62e88bda21..a577cee027939 100644 --- a/addons/sale/static/src/js/payment_form.js +++ b/addons/sale/static/src/js/payment_form.js @@ -1,7 +1,7 @@ /** @odoo-module **/ - - import checkoutForm from "payment.checkout_form"; - import manageForm from "payment.manage_form"; + + import checkoutForm from "@payment/js/checkout_form"; + import manageForm from "@payment/js/manage_form"; const salePaymentMixin = { @@ -12,7 +12,7 @@ /** * Add `sale_order_id` to the transaction route params if it is provided. * - * @override method from payment.payment_form_mixin + * @override method from @payment/js/payment_form_mixin * @private * @param {string} code - The code of the selected payment option's provider * @param {number} paymentOptionId - The id of the selected payment option diff --git a/addons/sale/static/src/js/sale_portal.js b/addons/sale/static/src/js/sale_portal.js index fa7c8431154a7..69da6197a8ec4 100644 --- a/addons/sale/static/src/js/sale_portal.js +++ b/addons/sale/static/src/js/sale_portal.js @@ -1,9 +1,8 @@ /** @odoo-module */ -import publicWidget from 'web.public.widget'; -import "@portal/js/portal"; // force dependencies +import { PortalHomeCounters } from '@portal/js/portal'; -publicWidget.registry.PortalHomeCounters.include({ +PortalHomeCounters.include({ /** * @override */ diff --git a/addons/sale/static/src/js/sale_portal_sidebar.js b/addons/sale/static/src/js/sale_portal_sidebar.js index 9cebe8fadf024..56e6e81389840 100644 --- a/addons/sale/static/src/js/sale_portal_sidebar.js +++ b/addons/sale/static/src/js/sale_portal_sidebar.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import publicWidget from "web.public.widget"; -import PortalSidebar from "portal.PortalSidebar"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import PortalSidebar from "@portal/js/portal_sidebar"; import { uniqueId } from "@web/core/utils/functions"; publicWidget.registry.SalePortalSidebar = PortalSidebar.extend({ diff --git a/addons/sale/static/src/js/tours/sale.js b/addons/sale/static/src/js/tours/sale.js index 57aec0f3c8473..f11faf747b59b 100644 --- a/addons/sale/static/src/js/tours/sale.js +++ b/addons/sale/static/src/js/tours/sale.js @@ -1,10 +1,10 @@ /** @odoo-module **/ -import {_t} from "web.core"; -import {Markup} from "web.utils"; +import {_t} from "@web/legacy/js/services/core"; +import { Markup } from "@web/legacy/js/core/utils"; import { registry } from "@web/core/registry"; import { stepUtils } from "@web_tour/tour_service/tour_utils"; -import "web.legacy_tranlations_loaded"; +import "@web/legacy/translations_loaded"; const { markup } = owl; diff --git a/addons/sale_expense/static/src/js/sale_order_many2one.js b/addons/sale_expense/static/src/js/sale_order_many2one.js index 7fd19e1b8f860..4191db8245a36 100644 --- a/addons/sale_expense/static/src/js/sale_order_many2one.js +++ b/addons/sale_expense/static/src/js/sale_order_many2one.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=sale_expense.sale_order_many2one **/ +/** @odoo-module **/ import { Many2OneField, many2OneField } from '@web/views/fields/many2one/many2one_field'; diff --git a/addons/sale_management/static/src/js/sale_management.js b/addons/sale_management/static/src/js/sale_management.js index a5b9e75964bff..a0c9ab18e0e52 100644 --- a/addons/sale_management/static/src/js/sale_management.js +++ b/addons/sale_management/static/src/js/sale_management.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import publicWidget from "web.public.widget"; +import publicWidget from "@web/legacy/js/public/public_widget"; publicWidget.registry.SaleUpdateLineButton = publicWidget.Widget.extend({ selector: '.o_portal_sale_sidebar', diff --git a/addons/sale_timesheet/static/tests/tours/sale_timesheet_tour.js b/addons/sale_timesheet/static/tests/tours/sale_timesheet_tour.js index 0e4d4b1ad5eba..e9ba0aba7f0d4 100644 --- a/addons/sale_timesheet/static/tests/tours/sale_timesheet_tour.js +++ b/addons/sale_timesheet/static/tests/tours/sale_timesheet_tour.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import {Markup} from "web.utils"; +import { Markup } from "@web/legacy/js/core/utils"; import { registry } from "@web/core/registry"; import { stepUtils } from "@web_tour/tour_service/tour_utils"; diff --git a/addons/spreadsheet/static/src/list/list_functions.js b/addons/spreadsheet/static/src/list/list_functions.js index 89e034c7a03c4..ecb676f62d7f0 100644 --- a/addons/spreadsheet/static/src/list/list_functions.js +++ b/addons/spreadsheet/static/src/list/list_functions.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import { _t } from "web.core"; +import { _t } from "@web/legacy/js/services/core"; import * as spreadsheet from "@odoo/o-spreadsheet"; import { sprintf } from "@web/core/utils/strings"; diff --git a/addons/spreadsheet/static/src/pivot/pivot_helpers.js b/addons/spreadsheet/static/src/pivot/pivot_helpers.js index 7e36e100fd8df..2236e1077c91d 100644 --- a/addons/spreadsheet/static/src/pivot/pivot_helpers.js +++ b/addons/spreadsheet/static/src/pivot/pivot_helpers.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import { _t } from "web.core"; +import { _t } from "@web/legacy/js/services/core"; import { FORMATS } from "../helpers/constants"; import { getOdooFunctions } from "../helpers/odoo_functions_helpers"; diff --git a/addons/survey/static/src/js/survey_breadcrumb.js b/addons/survey/static/src/js/survey_breadcrumb.js index 925dae4834eb5..4048be546ade4 100644 --- a/addons/survey/static/src/js/survey_breadcrumb.js +++ b/addons/survey/static/src/js/survey_breadcrumb.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=survey.breadcrumb **/ +/** @odoo-module **/ -import publicWidget from "web.public.widget"; +import publicWidget from "@web/legacy/js/public/public_widget"; publicWidget.registry.SurveyBreadcrumbWidget = publicWidget.Widget.extend({ template: "survey.survey_breadcrumb_template", diff --git a/addons/survey/static/src/js/survey_form.js b/addons/survey/static/src/js/survey_form.js index 64f3b2ae913ef..0fb9b9a462628 100644 --- a/addons/survey/static/src/js/survey_form.js +++ b/addons/survey/static/src/js/survey_form.js @@ -1,15 +1,15 @@ -/** @odoo-module alias=survey.form **/ - -import field_utils from "web.field_utils"; -import publicWidget from "web.public.widget"; -import time from "web.time"; -import config from "web.config"; -import core from "web.core"; -import Dialog from "web.Dialog"; -import dom from "web.dom"; -import {getCookie, setCookie, deleteCookie} from "web.utils.cookies"; - -import SurveyPreloadImageMixin from "survey.preload_image_mixin"; +/** @odoo-module **/ + +import field_utils from "@web/legacy/js/fields/field_utils"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import time from "@web/legacy/js/core/time"; +import config from "@web/legacy/js/services/config"; +import core from "@web/legacy/js/services/core"; +import Dialog from "@web/legacy/js/core/dialog"; +import dom from "@web/legacy/js/core/dom"; +import {getCookie, setCookie, deleteCookie} from "@web/legacy/js/core/cookie_utils"; + +import SurveyPreloadImageMixin from "@survey/js/survey_preload_image_mixin"; import { SurveyImageZoomer } from "@survey/js/survey_image_zoomer"; var _t = core._t; diff --git a/addons/survey/static/src/js/survey_image_zoomer.js b/addons/survey/static/src/js/survey_image_zoomer.js index cd31005cea193..f3e2def95d8fe 100644 --- a/addons/survey/static/src/js/survey_image_zoomer.js +++ b/addons/survey/static/src/js/survey_image_zoomer.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import publicWidget from 'web.public.widget'; +import publicWidget from '@web/legacy/js/public/public_widget'; export const SurveyImageZoomer = publicWidget.Widget.extend({ template: 'survey.survey_image_zoomer', diff --git a/addons/survey/static/src/js/survey_preload_image_mixin.js b/addons/survey/static/src/js/survey_preload_image_mixin.js index 21240b2c3717a..3a33003c0ff2b 100644 --- a/addons/survey/static/src/js/survey_preload_image_mixin.js +++ b/addons/survey/static/src/js/survey_preload_image_mixin.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=survey.preload_image_mixin **/ +/** @odoo-module **/ export default { diff --git a/addons/survey/static/src/js/survey_print.js b/addons/survey/static/src/js/survey_print.js index d31f432b427e7..e873af9b07290 100644 --- a/addons/survey/static/src/js/survey_print.js +++ b/addons/survey/static/src/js/survey_print.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=survey.print **/ +/** @odoo-module **/ -import publicWidget from "web.public.widget"; -import dom from "web.dom"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import dom from "@web/legacy/js/core/dom"; publicWidget.registry.SurveyPrintWidget = publicWidget.Widget.extend({ selector: '.o_survey_print', diff --git a/addons/survey/static/src/js/survey_quick_access.js b/addons/survey/static/src/js/survey_quick_access.js index 235ed8fffa01f..653cec8aff647 100644 --- a/addons/survey/static/src/js/survey_quick_access.js +++ b/addons/survey/static/src/js/survey_quick_access.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=survey.quick.access **/ +/** @odoo-module **/ -import publicWidget from "web.public.widget"; +import publicWidget from "@web/legacy/js/public/public_widget"; publicWidget.registry.SurveyQuickAccessWidget = publicWidget.Widget.extend({ selector: '.o_survey_quick_access', @@ -23,7 +23,7 @@ publicWidget.registry.SurveyQuickAccessWidget = publicWidget.Widget.extend({ // Init event listener if (!self.readonly) { $(document).on('keypress', self._onKeyPress.bind(self)); - } + } }); }, diff --git a/addons/survey/static/src/js/survey_result.js b/addons/survey/static/src/js/survey_result.js index fe626ad8457b7..2253622e8f355 100644 --- a/addons/survey/static/src/js/survey_result.js +++ b/addons/survey/static/src/js/survey_result.js @@ -1,9 +1,9 @@ -/** @odoo-module alias=survey.result **/ +/** @odoo-module **/ -import { _t } from "web.core"; +import { _t } from "@web/legacy/js/services/core"; import { loadJS } from "@web/core/assets"; import { SurveyImageZoomer } from "@survey/js/survey_image_zoomer"; -import publicWidget from "web.public.widget"; +import publicWidget from "@web/legacy/js/public/public_widget"; // The given colors are the same as those used by D3 var D3_COLORS = ["#1f77b4","#ff7f0e","#aec7e8","#ffbb78","#2ca02c","#98df8a","#d62728", diff --git a/addons/survey/static/src/js/survey_session_chart.js b/addons/survey/static/src/js/survey_session_chart.js index 99c941ccd928a..a4092bfe1308d 100644 --- a/addons/survey/static/src/js/survey_session_chart.js +++ b/addons/survey/static/src/js/survey_session_chart.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=survey.session_chart **/ +/** @odoo-module **/ -import publicWidget from "web.public.widget"; -import SESSION_CHART_COLORS from "survey.session_colors"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import SESSION_CHART_COLORS from "@survey/js/survey_session_colors"; publicWidget.registry.SurveySessionChart = publicWidget.Widget.extend({ init: function (parent, options) { @@ -173,15 +173,15 @@ publicWidget.registry.SurveySessionChart = publicWidget.Widget.extend({ * Each value of the array represents a line of the label. * So for this example above: it will be displayed as: * "this is an examble
of a label", breaking the label in 2 parts and put on 2 lines visually. - * + * * What we do here is rework the labels with our own algorithm to make them fit better in screen space * based on breakpoints based on number of columns to display. * So this example will become: ["this is an", "example of", "a label"] if we have a lot of labels to put in the chart. * Which will be displayed as "this is an
example of
a label" * Obviously, the more labels you have, the more columns, and less screen space is available. - * + * * We also adapt the font size based on the width available in the chart. - * + * * So we counterbalance multiple times: * - Based on number of columns (i.e. number of survey.question.answer of your current survey.question), * we split the words of every labels to make them display on more rows. @@ -189,8 +189,8 @@ publicWidget.registry.SurveySessionChart = publicWidget.Widget.extend({ * we reduce the chart font to be able to fit more characters. * - Based on the longest word present in the labels, we apply a certain ratio with the width of the chart * to get a more accurate font size for the space available. - * - * @param {Object} chart + * + * @param {Object} chart */ beforeInit: function (chart) { const nbrCol = chart.data.labels.length; diff --git a/addons/survey/static/src/js/survey_session_colors.js b/addons/survey/static/src/js/survey_session_colors.js index 292c713f2d7b0..7ca800f17d970 100644 --- a/addons/survey/static/src/js/survey_session_colors.js +++ b/addons/survey/static/src/js/survey_session_colors.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=survey.session_colors **/ +/** @odoo-module **/ /** * Small tool that returns common colors for survey session widgets. diff --git a/addons/survey/static/src/js/survey_session_leaderboard.js b/addons/survey/static/src/js/survey_session_leaderboard.js index 9ddaf84913212..090a9080b77c5 100644 --- a/addons/survey/static/src/js/survey_session_leaderboard.js +++ b/addons/survey/static/src/js/survey_session_leaderboard.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=survey.session_leaderboard **/ +/** @odoo-module **/ -import publicWidget from "web.public.widget"; -import SESSION_CHART_COLORS from "survey.session_colors"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import SESSION_CHART_COLORS from "@survey/js/survey_session_colors"; publicWidget.registry.SurveySessionLeaderboard = publicWidget.Widget.extend({ init: function (parent, options) { diff --git a/addons/survey/static/src/js/survey_session_manage.js b/addons/survey/static/src/js/survey_session_manage.js index 3ff31e8a6b2d3..674d82a109118 100644 --- a/addons/survey/static/src/js/survey_session_manage.js +++ b/addons/survey/static/src/js/survey_session_manage.js @@ -1,11 +1,11 @@ -/** @odoo-module alias=survey.session_manage **/ - -import publicWidget from "web.public.widget"; -import SurveyPreloadImageMixin from "survey.preload_image_mixin"; -import SurveySessionChart from "survey.session_chart"; -import SurveySessionTextAnswers from "survey.session_text_answers"; -import SurveySessionLeaderBoard from "survey.session_leaderboard"; -import {_lt} from "web.core"; +/** @odoo-module **/ + +import publicWidget from "@web/legacy/js/public/public_widget"; +import SurveyPreloadImageMixin from "@survey/js/survey_preload_image_mixin"; +import SurveySessionChart from "@survey/js/survey_session_chart"; +import SurveySessionTextAnswers from "@survey/js/survey_session_text_answers"; +import SurveySessionLeaderBoard from "@survey/js/survey_session_leaderboard"; +import {_lt} from "@web/legacy/js/services/core"; const nextPageTooltips = { closingWords: _lt('End of Survey'), diff --git a/addons/survey/static/src/js/survey_session_text_answers.js b/addons/survey/static/src/js/survey_session_text_answers.js index 93990aca28b71..e47f7dcfe5c55 100644 --- a/addons/survey/static/src/js/survey_session_text_answers.js +++ b/addons/survey/static/src/js/survey_session_text_answers.js @@ -1,9 +1,9 @@ -/** @odoo-module alias=survey.session_text_answers **/ +/** @odoo-module **/ -import publicWidget from "web.public.widget"; -import core from "web.core"; -import time from "web.time"; -import SESSION_CHART_COLORS from "survey.session_colors"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import core from "@web/legacy/js/services/core"; +import time from "@web/legacy/js/core/time"; +import SESSION_CHART_COLORS from "@survey/js/survey_session_colors"; var QWeb = core.qweb; diff --git a/addons/survey/static/src/js/survey_timer.js b/addons/survey/static/src/js/survey_timer.js index 4b27e410c31ee..d157229b936a7 100644 --- a/addons/survey/static/src/js/survey_timer.js +++ b/addons/survey/static/src/js/survey_timer.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=survey.timer **/ +/** @odoo-module **/ -import publicWidget from "web.public.widget"; +import publicWidget from "@web/legacy/js/public/public_widget"; publicWidget.registry.SurveyTimerWidget = publicWidget.Widget.extend({ //-------------------------------------------------------------------------- diff --git a/addons/survey/static/src/js/tours/survey_tour.js b/addons/survey/static/src/js/tours/survey_tour.js index 595cf4e1a5425..437b94db3a6f1 100644 --- a/addons/survey/static/src/js/tours/survey_tour.js +++ b/addons/survey/static/src/js/tours/survey_tour.js @@ -1,8 +1,8 @@ /** @odoo-module */ -import { _t } from 'web.core'; -import "web.legacy_tranlations_loaded"; -import { Markup } from 'web.utils'; +import { _t } from "@web/legacy/js/services/core"; +import "@web/legacy/translations_loaded"; +import { Markup } from "@web/legacy/js/core/utils"; import { registry } from "@web/core/registry"; import { stepUtils } from "@web_tour/tour_service/tour_utils"; @@ -28,7 +28,7 @@ registry.category("web_tour.tours").add('survey_tour', { trigger: '.o_survey_simple_choice button[type=submit]', extra_trigger: '.js_question-wrapper span:contains("How frequently")', content: _t("Whenever you pick an answer, Odoo saves it for you."), - position: 'bottom', + position: 'bottom', }, { trigger: '.o_survey_numerical_box button[type=submit]', extra_trigger: '.js_question-wrapper span:contains("How many")', diff --git a/addons/survey/static/tests/tours/certification_failure.js b/addons/survey/static/tests/tours/certification_failure.js index 09dfd0e80d0f0..346f1e0544731 100644 --- a/addons/survey/static/tests/tours/certification_failure.js +++ b/addons/survey/static/tests/tours/certification_failure.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import SurveyFormWidget from "survey.form"; +import SurveyFormWidget from "@survey/js/survey_form"; /** * Speed up fade-in fade-out to avoid useless delay in tests. */ diff --git a/addons/survey/static/tests/tours/certification_success.js b/addons/survey/static/tests/tours/certification_success.js index 55430a56fdb91..419748605b9c6 100644 --- a/addons/survey/static/tests/tours/certification_success.js +++ b/addons/survey/static/tests/tours/certification_success.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import SurveyFormWidget from "survey.form"; +import SurveyFormWidget from "@survey/js/survey_form"; /** * Speed up fade-in fade-out to avoid useless delay in tests. */ diff --git a/addons/survey/static/tests/tours/survey_session_manage_test.js b/addons/survey/static/tests/tours/survey_session_manage_test.js index b794b4ef9d2e3..1a5635d9f337b 100644 --- a/addons/survey/static/tests/tours/survey_session_manage_test.js +++ b/addons/survey/static/tests/tours/survey_session_manage_test.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=survey.session_manage_test **/ +/** @odoo-module **/ -import SessionManager from "survey.session_manage"; +import SessionManager from "@survey/js/survey_session_manage"; /** * Small override for test/tour purposes. */ diff --git a/addons/test_mail/static/tests/activity_tests.js b/addons/test_mail/static/tests/activity_tests.js index d6256a759e158..464ceb4b91580 100644 --- a/addons/test_mail/static/tests/activity_tests.js +++ b/addons/test_mail/static/tests/activity_tests.js @@ -5,7 +5,7 @@ import { ActivityRenderer } from "@mail/views/web/activity/activity_renderer"; import { start, startServer } from "@mail/../tests/helpers/test_utils"; import { serializeDate } from "@web/core/l10n/dates"; -import testUtils from "web.test_utils"; +import testUtils from "@web/../tests/legacy/helpers/test_utils"; import { editInput, diff --git a/addons/test_mail/static/tests/systray_activity_menu_tests.js b/addons/test_mail/static/tests/systray_activity_menu_tests.js index 8d3d792583951..f5c75931a5636 100644 --- a/addons/test_mail/static/tests/systray_activity_menu_tests.js +++ b/addons/test_mail/static/tests/systray_activity_menu_tests.js @@ -3,7 +3,7 @@ import { start, startServer, click } from "@mail/../tests/helpers/test_utils"; import { session } from "@web/session"; -import { date_to_str } from "web.time"; +import { date_to_str } from "@web/legacy/js/core/time"; import { patchWithCleanup } from "@web/../tests/helpers/utils"; QUnit.module("activity menu"); diff --git a/addons/test_mail/static/tests/tracking_value_tests.js b/addons/test_mail/static/tests/tracking_value_tests.js index 41bd0949dbda5..fb91b25092ca9 100644 --- a/addons/test_mail/static/tests/tracking_value_tests.js +++ b/addons/test_mail/static/tests/tracking_value_tests.js @@ -12,7 +12,7 @@ import { } from "@web/../tests/helpers/utils"; import session from "web.session"; -import testUtils from "web.test_utils"; +import testUtils from "@web/../tests/legacy/helpers/test_utils"; let target; diff --git a/addons/test_website/static/src/js/test_error.js b/addons/test_website/static/src/js/test_error.js index 0afdd21315320..14adac770f361 100644 --- a/addons/test_website/static/src/js/test_error.js +++ b/addons/test_website/static/src/js/test_error.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import publicWidget from "web.public.widget"; +import publicWidget from "@web/legacy/js/public/public_widget"; publicWidget.registry.testError = publicWidget.Widget.extend({ selector: '.rpc_error', diff --git a/addons/test_website/static/tests/field_html_file_upload.js b/addons/test_website/static/tests/field_html_file_upload.js index 395f67ef9c3f6..7cfaf6c4f6013 100644 --- a/addons/test_website/static/tests/field_html_file_upload.js +++ b/addons/test_website/static/tests/field_html_file_upload.js @@ -4,12 +4,12 @@ import { FileSelectorControlPanel } from '@web_editor/components/media_dialog/fi import { getFixture, patchWithCleanup } from "@web/../tests/helpers/utils"; import { HtmlField } from '@web_editor/js/backend/html_field'; import {registry} from '@web/core/registry'; -import testUtils from 'web.test_utils'; +import testUtils from '@web/../tests/legacy/helpers/test_utils'; import { uploadService } from '@web_editor/components/upload_progress_toast/upload_service'; import { unsplashService } from '@web_unsplash/services/unsplash_service'; import { createWebClient, doAction } from "@web/../tests/webclient/helpers"; -import weTestUtils from 'web_editor.test_utils'; -import { Wysiwyg } from '@web_editor/js/wysiwyg/wysiwyg'; +import weTestUtils from '@web_editor/../tests/test_utils'; +import {Wysiwyg} from '@web_editor/js/wysiwyg/wysiwyg'; const { useEffect } = owl; diff --git a/addons/test_website/static/tests/tours/custom_snippets.js b/addons/test_website/static/tests/tours/custom_snippets.js index 757b89ed6be62..e75d3269ca39d 100644 --- a/addons/test_website/static/tests/tours/custom_snippets.js +++ b/addons/test_website/static/tests/tours/custom_snippets.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from "website.tour_utils"; +import wTourUtils from "@website/js/tours/tour_utils"; /** * The purpose of this tour is to check the custom snippets flow: diff --git a/addons/test_website/static/tests/tours/image_link.js b/addons/test_website/static/tests/tours/image_link.js index 114d677385789..978a0f5910bcb 100644 --- a/addons/test_website/static/tests/tours/image_link.js +++ b/addons/test_website/static/tests/tours/image_link.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; /** * The purpose of this tour is to check the link on image flow. diff --git a/addons/test_website/static/tests/tours/image_upload_progress.js b/addons/test_website/static/tests/tours/image_upload_progress.js index 0e15a30796b6a..95ab7204b51d6 100644 --- a/addons/test_website/static/tests/tours/image_upload_progress.js +++ b/addons/test_website/static/tests/tours/image_upload_progress.js @@ -1,9 +1,9 @@ /** @odoo-module **/ -import wTourUtils from "website.tour_utils"; +import wTourUtils from "@website/js/tours/tour_utils"; import { FileSelectorControlPanel } from "@web_editor/components/media_dialog/file_selector"; -import { patch, unpatch } from "web.utils"; +import { patch, unpatch } from '@web/legacy/js/core/utils'; let patchWithError = false; const patchMediaDialog = () => patch(FileSelectorControlPanel.prototype, 'test_website.mock_image_widgets', { diff --git a/addons/test_website/static/tests/tours/replace_media.js b/addons/test_website/static/tests/tours/replace_media.js index e1e66f8884be0..8d9ffa2845584 100644 --- a/addons/test_website/static/tests/tours/replace_media.js +++ b/addons/test_website/static/tests/tours/replace_media.js @@ -2,7 +2,7 @@ import { patch } from '@web/core/utils/patch'; import { VideoSelector } from '@web_editor/components/media_dialog/video_selector'; -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; const VIDEO_URL = 'https://www.youtube.com/watch?v=Dpq87YCHmJc'; diff --git a/addons/test_website/static/tests/tours/reset_views.js b/addons/test_website/static/tests/tours/reset_views.js index 981d3328d4844..dc66be83a62ab 100644 --- a/addons/test_website/static/tests/tours/reset_views.js +++ b/addons/test_website/static/tests/tours/reset_views.js @@ -1,7 +1,7 @@ /** @odoo-module **/ /* global ace */ -import wTourUtils from "website.tour_utils"; +import wTourUtils from "@website/js/tours/tour_utils"; var BROKEN_STEP = { // because saving a broken template opens a recovery page with no assets diff --git a/addons/test_website_modules/static/tests/tours/configurator_flow.js b/addons/test_website_modules/static/tests/tours/configurator_flow.js index 3796244ed5086..49ed9d9ef468c 100644 --- a/addons/test_website_modules/static/tests/tours/configurator_flow.js +++ b/addons/test_website_modules/static/tests/tours/configurator_flow.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { registry } from "@web/core/registry"; -import wTourUtils from "website.tour_utils"; +import wTourUtils from "@website/js/tours/tour_utils"; registry.category("web_tour.tours").add('configurator_flow', { test: true, diff --git a/addons/test_website_slides_full/static/tests/tours/slides_certification_member.js b/addons/test_website_slides_full/static/tests/tours/slides_certification_member.js index e4480476cf3a2..f83f6dbb85a42 100644 --- a/addons/test_website_slides_full/static/tests/tours/slides_certification_member.js +++ b/addons/test_website_slides_full/static/tests/tours/slides_certification_member.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { registry } from "@web/core/registry"; -import tourUtils from 'website_sale.tour_utils'; +import tourUtils from '@website_sale/js/tours/tour_utils'; /** * The purpose of this tour is to check the whole certification flow: diff --git a/addons/web/static/src/legacy/frontend/keyboard_navigation_mixin.js b/addons/web/static/src/legacy/frontend/keyboard_navigation_mixin.js index dd3aff9c6ef7e..4e13de773c810 100644 --- a/addons/web/static/src/legacy/frontend/keyboard_navigation_mixin.js +++ b/addons/web/static/src/legacy/frontend/keyboard_navigation_mixin.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=web.KeyboardNavigationMixin **/ -import BrowserDetection from "web.BrowserDetection"; - import core from "web.core"; +/** @odoo-module **/ +import BrowserDetection from "@web/legacy/js/core/browser_detection"; + import core from "@web/legacy/js/services/core"; /** * list of the key that should not be used as accesskeys. Either because we want to reserve them for a specific behavior in Odoo or diff --git a/addons/web/static/src/legacy/js/assets.js b/addons/web/static/src/legacy/js/assets.js index 10c7bb1b3979c..8edc49e1942e5 100644 --- a/addons/web/static/src/legacy/js/assets.js +++ b/addons/web/static/src/legacy/js/assets.js @@ -13,8 +13,8 @@ assets.loadXML = function (xml, app) { } // don't use require to apply the patch before the first template loading. - odoo.ready('web.core').then(function () { - const core = odoo.__DEBUG__.services['web.core']; - core.qweb.add_template(qwebTemplates); + odoo.ready('@web/legacy/js/services/core').then(function () { + const { qweb } = odoo.__DEBUG__.services['@web/legacy/js/services/core']; + qweb.add_template(qwebTemplates); }); } diff --git a/addons/web/static/src/legacy/js/common_env.js b/addons/web/static/src/legacy/js/common_env.js index e64f2980a044e..dbbfb621ffebf 100644 --- a/addons/web/static/src/legacy/js/common_env.js +++ b/addons/web/static/src/legacy/js/common_env.js @@ -1,5 +1,5 @@ -/** @odoo-module alias=web.commonEnv **/ - +/** @odoo-module **/ + /** * This file defines the common environment, which contains everything that * is needed in the env for both the backend and the frontend (Odoo @@ -16,14 +16,15 @@ * [1] https://github.com/odoo/owl/blob/master/doc/reference/environment.md#content-of-an-environment */ - import { jsonRpc } from "web.ajax"; - import { device, isDebug } from "web.config"; - import { bus } from "web.core"; - import rpc from "web.rpc"; + import { jsonRpc } from "@web/legacy/js/core/ajax"; + import config from "@web/legacy/js/services/config"; + import { bus } from "@web/legacy/js/services/core"; + import rpc from "@web/legacy/js/core/rpc"; import session from "web.session"; - import { _t } from "web.translation"; - import {getCookie, setCookie} from "web.utils.cookies"; + import { _t } from "@web/legacy/js/core/translation"; + import {getCookie, setCookie} from "@web/legacy/js/core/cookie_utils"; + const { device, isDebug } = config const browser = { clearInterval: window.clearInterval.bind(window), clearTimeout: window.clearTimeout.bind(window), diff --git a/addons/web/static/src/legacy/js/core/abstract_service.js b/addons/web/static/src/legacy/js/core/abstract_service.js index 3f282de42e283..f729821ee25a4 100644 --- a/addons/web/static/src/legacy/js/core/abstract_service.js +++ b/addons/web/static/src/legacy/js/core/abstract_service.js @@ -1,9 +1,9 @@ -/** @odoo-module alias=web.AbstractService **/ +/** @odoo-module **/ -import Class from "web.Class"; -import { serviceRegistry } from "web.core"; -import Mixins from "web.mixins"; -import ServicesMixin from "web.ServicesMixin"; +import Class from "@web/legacy/js/core/class"; +import { serviceRegistry } from "@web/legacy/js/services/core"; +import Mixins from "@web/legacy/js/core/mixins"; +import ServicesMixin from "@web/legacy/js/core/service_mixins"; var AbstractService = Class.extend(Mixins.EventDispatcherMixin, ServicesMixin, { dependencies: [], diff --git a/addons/web/static/src/legacy/js/core/abstract_storage_service.js b/addons/web/static/src/legacy/js/core/abstract_storage_service.js index 8ebc12aa2d4b1..a675798ca615e 100644 --- a/addons/web/static/src/legacy/js/core/abstract_storage_service.js +++ b/addons/web/static/src/legacy/js/core/abstract_storage_service.js @@ -1,11 +1,11 @@ -/** @odoo-module alias=web.AbstractStorageService **/ +/** @odoo-module **/ /** * This module defines an abstraction for services that write into Storage * objects (e.g. localStorage or sessionStorage). */ -import AbstractService from "web.AbstractService"; +import AbstractService from "@web/legacy/js/core/abstract_service"; var AbstractStorageService = AbstractService.extend({ // the 'storage' attribute must be set by actual StorageServices extending diff --git a/addons/web/static/src/legacy/js/core/ajax.js b/addons/web/static/src/legacy/js/core/ajax.js index 157f30c705b82..e78c8dbd11922 100644 --- a/addons/web/static/src/legacy/js/core/ajax.js +++ b/addons/web/static/src/legacy/js/core/ajax.js @@ -1,11 +1,11 @@ -/** @odoo-module alias=web.ajax **/ +/** @odoo-module **/ -import config from "web.config"; -import core from "web.core"; -import {Markup} from "web.utils"; -import time from "web.time"; -import download from "web.download"; -import contentdisposition from "web.contentdisposition"; +import config from "@web/legacy/js/services/config"; +import core from "@web/legacy/js/services/core"; +import { Markup } from "@web/legacy/js/core/utils"; +import time from "@web/legacy/js/core/time"; +import download from "@web/legacy/js/libs/download"; +import contentdisposition from "@web/legacy/js/libs/content-disposition"; import { session } from "@web/session"; var _t = core._t; @@ -122,7 +122,7 @@ function _genericJsonRpc (fct_name, params, settings, fct) { return promise; }; -function jsonRpc(url, fct_name, params, settings) { +export function jsonRpc(url, fct_name, params, settings) { settings = settings || {}; return _genericJsonRpc(fct_name, params, settings, function(data) { return $.ajax(url, Object.assign({}, settings, { diff --git a/addons/web/static/src/legacy/js/core/browser_detection.js b/addons/web/static/src/legacy/js/core/browser_detection.js index a6824c2e1c54a..9d53e83aa88b9 100644 --- a/addons/web/static/src/legacy/js/core/browser_detection.js +++ b/addons/web/static/src/legacy/js/core/browser_detection.js @@ -1,5 +1,5 @@ -/** @odoo-module alias=web.BrowserDetection **/ - import Class from "web.Class"; +/** @odoo-module **/ + import Class from "@web/legacy/js/core/class"; import { isMacOS, isBrowserChrome } from "@web/core/browser/feature_detection"; var BrowserDetection = Class.extend({ diff --git a/addons/web/static/src/legacy/js/core/bus.js b/addons/web/static/src/legacy/js/core/bus.js index f49b4eaab75d3..f8107a81258cb 100644 --- a/addons/web/static/src/legacy/js/core/bus.js +++ b/addons/web/static/src/legacy/js/core/bus.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=web.Bus **/ +/** @odoo-module **/ -import Class from "web.Class"; -import mixins from "web.mixins"; +import Class from "@web/legacy/js/core/class"; +import mixins from "@web/legacy/js/core/mixins"; /** * Event Bus used to bind events scoped in the current instance diff --git a/addons/web/static/src/legacy/js/core/class.js b/addons/web/static/src/legacy/js/core/class.js index 21d2091d3716b..08aa36c6814bd 100644 --- a/addons/web/static/src/legacy/js/core/class.js +++ b/addons/web/static/src/legacy/js/core/class.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=web.Class **/ +/** @odoo-module **/ /** * Improved John Resig's inheritance, based on: * diff --git a/addons/web/static/src/legacy/js/core/collections.js b/addons/web/static/src/legacy/js/core/collections.js index c54e3fc459427..8374f94bbd690 100644 --- a/addons/web/static/src/legacy/js/core/collections.js +++ b/addons/web/static/src/legacy/js/core/collections.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=web.collections **/ - - import Class from "web.Class"; +/** @odoo-module **/ + + import Class from "@web/legacy/js/core/class"; /** * Allows to build a tree representation of a data. diff --git a/addons/web/static/src/legacy/js/core/concurrency.js b/addons/web/static/src/legacy/js/core/concurrency.js index f30e8ca573f39..8b862e3738b3b 100644 --- a/addons/web/static/src/legacy/js/core/concurrency.js +++ b/addons/web/static/src/legacy/js/core/concurrency.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=web.concurrency **/ +/** @odoo-module **/ /** * Concurrency Utils @@ -14,9 +14,9 @@ * we solved some concurrency issues, when we noticed that a pattern emerged. */ -import Class from "web.Class"; +import Class from "@web/legacy/js/core/class"; -export default { +const concurrency = { /** * Returns a promise resolved after 'wait' milliseconds * @@ -318,3 +318,7 @@ export default { }); } }; + +export const delay = concurrency.delay +export const DropPrevious = concurrency.DropPrevious +export default concurrency; diff --git a/addons/web/static/src/legacy/js/core/context.js b/addons/web/static/src/legacy/js/core/context.js index e9c59f60813d6..673ab7bcbf0f8 100644 --- a/addons/web/static/src/legacy/js/core/context.js +++ b/addons/web/static/src/legacy/js/core/context.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=web.Context **/ +/** @odoo-module **/ -import Class from "web.Class"; -import pyUtils from "web.py_utils"; +import Class from "@web/legacy/js/core/class"; +import pyUtils from "@web/legacy/js/core/py_utils"; var Context = Class.extend({ init: function () { diff --git a/addons/web/static/src/legacy/js/core/cookie_utils.js b/addons/web/static/src/legacy/js/core/cookie_utils.js index a5c9766a12a28..1a79c466f2074 100644 --- a/addons/web/static/src/legacy/js/core/cookie_utils.js +++ b/addons/web/static/src/legacy/js/core/cookie_utils.js @@ -1,72 +1,76 @@ -/** @odoo-module alias=web.utils.cookies **/ +/** @odoo-module **/ -const utils = { - /** - * Reads the cookie described by the given name. - * - * @param {string} cookieName - * @returns {string} - */ - getCookie(cookieName) { - var cookies = document.cookie ? document.cookie.split('; ') : []; - for (var i = 0, l = cookies.length; i < l; i++) { - var parts = cookies[i].split('='); - var name = parts.shift(); - var cookie = parts.join('='); +/** + * Reads the cookie described by the given name. + * + * @param {string} cookieName + * @returns {string} + */ +export function getCookie(cookieName) { + var cookies = document.cookie ? document.cookie.split('; ') : []; + for (var i = 0, l = cookies.length; i < l; i++) { + var parts = cookies[i].split('='); + var name = parts.shift(); + var cookie = parts.join('='); - if (cookieName && cookieName === name) { - if (cookie.startsWith('"')) { - if (cookie.includes('\\')){ - // see werkzeug _cookie_quote - throw new Error( - `Cookie value contains unknown characters ${cookie}` - ) - } - cookie = cookie.slice(1, -1); + if (cookieName && cookieName === name) { + if (cookie.startsWith('"')) { + if (cookie.includes('\\')){ + // see werkzeug _cookie_quote + throw new Error( + `Cookie value contains unknown characters ${cookie}` + ) } - return cookie; + cookie = cookie.slice(1, -1); } + return cookie; } - return ""; - }, - /** - * Check if cookie can be written. - * - * @param {String} type the type of the cookie - * @returns {boolean} - */ - isAllowedCookie(type) { - return true; - }, - /** - * Creates a cookie. - * - * @param {string} name the name of the cookie - * @param {string} value the value stored in the cookie - * @param {integer} ttl time to live of the cookie in millis. -1 to erase the cookie. - * @param {string} type the type of the cookies ('required' as default value) - */ - setCookie(name, value, ttl = 31536000, type = 'required') { - ttl = utils.isAllowedCookie(type) ? ttl || 24 * 60 * 60 * 365 : -1; - document.cookie = [ - `${name}=${value}`, - 'path=/', - `max-age=${ttl}`, - `expires=${new Date(new Date().getTime() + ttl * 1000).toGMTString()}`, - ].join(';'); - }, - /** - * Deletes a cookie. - * - * @param {string} name the name of the cookie - */ - deleteCookie(name) { - document.cookie = [ - `${name}=`, - 'path=/', - `max-age=-1`, - `expires=${new Date(new Date().getTime() - 1000).toGMTString()}`, - ].join(';'); - }, + } + return ""; +} +/** + * Check if cookie can be written. + * + * @param {String} type the type of the cookie + * @returns {boolean} + */ +export function isAllowedCookie(type) { + return true; +} +/** + * Creates a cookie. + * + * @param {string} name the name of the cookie + * @param {string} value the value stored in the cookie + * @param {integer} ttl time to live of the cookie in millis. -1 to erase the cookie. + * @param {string} type the type of the cookies ('required' as default value) + */ +export function setCookie(name, value, ttl = 31536000, type = 'required') { + ttl = isAllowedCookie(type) ? ttl || 24 * 60 * 60 * 365 : -1; + document.cookie = [ + `${name}=${value}`, + 'path=/', + `max-age=${ttl}`, + `expires=${new Date(new Date().getTime() + ttl * 1000).toGMTString()}`, + ].join(';'); +} +/** + * Deletes a cookie. + * + * @param {string} name the name of the cookie + */ +export function deleteCookie(name) { + document.cookie = [ + `${name}=`, + 'path=/', + `max-age=-1`, + `expires=${new Date(new Date().getTime() - 1000).toGMTString()}`, + ].join(';'); +} + +export default { + deleteCookie, + setCookie, + getCookie, + isAllowedCookie }; -export default utils; diff --git a/addons/web/static/src/legacy/js/core/dialog.js b/addons/web/static/src/legacy/js/core/dialog.js index 7ac03943be16b..6ed204bb4d4df 100644 --- a/addons/web/static/src/legacy/js/core/dialog.js +++ b/addons/web/static/src/legacy/js/core/dialog.js @@ -1,9 +1,9 @@ -/** @odoo-module alias=web.Dialog **/ +/** @odoo-module **/ -import core from "web.core"; -import dom from "web.dom"; -import Widget from "web.Widget"; -import OwlDialog from "web.OwlDialog"; +import core from "@web/legacy/js/services/core"; +import dom from "@web/legacy/js/core/dom"; +import Widget from "@web/legacy/js/core/widget"; +import OwlDialog from "@web/legacy/js/core/owl_dialog"; var QWeb = core.qweb; var _t = core._t; diff --git a/addons/web/static/src/legacy/js/core/dom.js b/addons/web/static/src/legacy/js/core/dom.js index 284e811121332..c72a70726136b 100644 --- a/addons/web/static/src/legacy/js/core/dom.js +++ b/addons/web/static/src/legacy/js/core/dom.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=web.dom **/ +/** @odoo-module **/ /** * DOM Utility helpers @@ -10,8 +10,8 @@ */ import { uniqueId } from "@web/core/utils/functions"; -import concurrency from "web.concurrency"; -import core from "web.core"; +import concurrency from "@web/legacy/js/core/concurrency"; +import core from "@web/legacy/js/services/core"; var _t = core._t; /** diff --git a/addons/web/static/src/legacy/js/core/domain.js b/addons/web/static/src/legacy/js/core/domain.js index 7a0a002483cfb..a1b3d3defdc5f 100644 --- a/addons/web/static/src/legacy/js/core/domain.js +++ b/addons/web/static/src/legacy/js/core/domain.js @@ -1,8 +1,8 @@ -/** @odoo-module alias=web.Domain **/ +/** @odoo-module **/ import { intersection } from "@web/core/utils/arrays"; -import collections from "web.collections"; -import pyUtils from "web.py_utils"; +import collections from "@web/legacy/js/core/collections"; +import pyUtils from "@web/legacy/js/core/py_utils"; var py = window.py; // look py.js const TRUE_LEAF = [1, '=', 1]; diff --git a/addons/web/static/src/legacy/js/core/local_storage.js b/addons/web/static/src/legacy/js/core/local_storage.js index b8030940e9d31..37151812f36d1 100644 --- a/addons/web/static/src/legacy/js/core/local_storage.js +++ b/addons/web/static/src/legacy/js/core/local_storage.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=web.local_storage **/ +/** @odoo-module **/ -import RamStorage from "web.RamStorage"; -import mixins from "web.mixins"; +import RamStorage from "@web/legacy/js/core/ram_storage"; +import mixins from "@web/legacy/js/core/mixins"; // use a fake localStorage in RAM if the native localStorage is unavailable // (e.g. private browsing in Safari) @@ -14,7 +14,7 @@ try { /* * We create an intermediate object in order to triggered the storage on - * this object. the localStorage. This simplifies testing and usage as + * this object. the localStorage. This simplifies testing and usage as * starages are commutable in services without change. Also, objects * that use storage do not have to know that events go through window, * it's not up to them to handle these cases. diff --git a/addons/web/static/src/legacy/js/core/misc.js b/addons/web/static/src/legacy/js/core/misc.js index 4d24a24ec8189..2d2f8f8bff4c8 100644 --- a/addons/web/static/src/legacy/js/core/misc.js +++ b/addons/web/static/src/legacy/js/core/misc.js @@ -1,8 +1,8 @@ -/** @odoo-module alias=web.framework **/ +/** @odoo-module **/ -import core from "web.core"; -import ajax from "web.ajax"; -import Widget from "web.Widget"; +import core from "@web/legacy/js/services/core"; +import ajax from "@web/legacy/js/core/ajax"; +import Widget from "@web/legacy/js/core/widget"; var _t = core._t; @@ -75,7 +75,7 @@ function unblockAccessKeys() { var throbbers = []; -function blockUI() { +export function blockUI() { var tmp = $.blockUI.apply($, arguments); var throbber = new Throbber(); throbbers.push(throbber); @@ -85,7 +85,7 @@ function blockUI() { return tmp; } -function unblockUI() { +export function unblockUI() { throbbers.forEach((throbber) => { throbber.destroy(); }); diff --git a/addons/web/static/src/legacy/js/core/mixins.js b/addons/web/static/src/legacy/js/core/mixins.js index d41768db143d4..1b82836b885e3 100644 --- a/addons/web/static/src/legacy/js/core/mixins.js +++ b/addons/web/static/src/legacy/js/core/mixins.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=web.mixins **/ +/** @odoo-module **/ -import Class from "web.Class"; -import utils from "web.utils"; +import Class from "@web/legacy/js/core/class"; +import utils from "@web/legacy/js/core/utils"; /** * Mixin to structure objects' life-cycles folowing a parent-children diff --git a/addons/web/static/src/legacy/js/core/owl_dialog.js b/addons/web/static/src/legacy/js/core/owl_dialog.js index b56ef003c93fe..c2f088465e1ae 100644 --- a/addons/web/static/src/legacy/js/core/owl_dialog.js +++ b/addons/web/static/src/legacy/js/core/owl_dialog.js @@ -1,5 +1,5 @@ -/** @odoo-module alias=web.OwlDialog **/ - +/** @odoo-module **/ + const { useRef, onMounted, onWillUnmount } = owl; const SIZE_CLASSES = { 'extra-large': 'modal-xl', diff --git a/addons/web/static/src/legacy/js/core/popover.js b/addons/web/static/src/legacy/js/core/popover.js index 44058266f511c..5271b9231a486 100644 --- a/addons/web/static/src/legacy/js/core/popover.js +++ b/addons/web/static/src/legacy/js/core/popover.js @@ -1,5 +1,5 @@ -/** @odoo-module alias=web.Popover **/ - +/** @odoo-module **/ + import { debounce, throttleForAnimation } from "@web/core/utils/timing"; import { LegacyComponent } from "@web/legacy/legacy_component"; const { status, onWillUnmount, useEffect, useRef, useState } = owl; diff --git a/addons/web/static/src/legacy/js/core/py_utils.js b/addons/web/static/src/legacy/js/core/py_utils.js index fc6f081c7c635..00abdf7e8ddba 100644 --- a/addons/web/static/src/legacy/js/core/py_utils.js +++ b/addons/web/static/src/legacy/js/core/py_utils.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=web.py_utils **/ +/** @odoo-module **/ -import core from "web.core"; +import core from "@web/legacy/js/services/core"; var _t = core._t; var py = window.py; // to silence linters diff --git a/addons/web/static/src/legacy/js/core/qweb.js b/addons/web/static/src/legacy/js/core/qweb.js index 6710a1b9f54f1..c45c9af52f737 100644 --- a/addons/web/static/src/legacy/js/core/qweb.js +++ b/addons/web/static/src/legacy/js/core/qweb.js @@ -1,8 +1,8 @@ -/** @odoo-module alias=web.QWeb **/ +/** @odoo-module **/ import { uniqueId } from "@web/core/utils/functions"; import { range } from "@web/core/utils/numbers"; -import translation from "web.translation"; +import translation from "@web/legacy/js/core/translation"; var _t = translation._t; diff --git a/addons/web/static/src/legacy/js/core/ram_storage.js b/addons/web/static/src/legacy/js/core/ram_storage.js index 655d25fa9757c..02e1f2ad18a37 100644 --- a/addons/web/static/src/legacy/js/core/ram_storage.js +++ b/addons/web/static/src/legacy/js/core/ram_storage.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=web.RamStorage **/ +/** @odoo-module **/ /** * This module defines an alternative of the Storage objects (localStorage, @@ -6,8 +6,8 @@ * are unavailable (e.g. in private browsing on Safari). */ -import Class from "web.Class"; -import mixins from "web.mixins"; +import Class from "@web/legacy/js/core/class"; +import mixins from "@web/legacy/js/core/mixins"; var RamStorage = Class.extend(mixins.EventDispatcherMixin, { diff --git a/addons/web/static/src/legacy/js/core/registry.js b/addons/web/static/src/legacy/js/core/registry.js index 1ef1d4547820c..2326922671c33 100644 --- a/addons/web/static/src/legacy/js/core/registry.js +++ b/addons/web/static/src/legacy/js/core/registry.js @@ -1,6 +1,7 @@ -/** @odoo-module alias=web.Registry **/ - - import { sortBy } from "web.utils"; +/** @odoo-module **/ + + + import { sortBy } from "@web/legacy/js/core/utils"; /** * The registry is really pretty much only a mapping from some keys to some diff --git a/addons/web/static/src/legacy/js/core/rpc.js b/addons/web/static/src/legacy/js/core/rpc.js index a36d325a2a3ae..a54a71efbb373 100644 --- a/addons/web/static/src/legacy/js/core/rpc.js +++ b/addons/web/static/src/legacy/js/core/rpc.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=web.rpc **/ +/** @odoo-module **/ -import ajax from "web.ajax"; +import ajax from "@web/legacy/js/core/ajax"; const rpc = { /** @@ -122,4 +122,5 @@ const rpc = { }, }; +export const buildQuery = rpc.buildQuery export default rpc; diff --git a/addons/web/static/src/legacy/js/core/service_mixins.js b/addons/web/static/src/legacy/js/core/service_mixins.js index f9e109ff08b96..dd0be03a714cd 100644 --- a/addons/web/static/src/legacy/js/core/service_mixins.js +++ b/addons/web/static/src/legacy/js/core/service_mixins.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=web.ServicesMixin **/ +/** @odoo-module **/ -import rpc from "web.rpc"; +import rpc from "@web/legacy/js/core/rpc"; /** * @mixin diff --git a/addons/web/static/src/legacy/js/core/session.js b/addons/web/static/src/legacy/js/core/session.js index 74f4dc06adf8b..742e9754abaec 100644 --- a/addons/web/static/src/legacy/js/core/session.js +++ b/addons/web/static/src/legacy/js/core/session.js @@ -1,9 +1,9 @@ -/** @odoo-module alias=web.Session **/ +/** @odoo-module **/ -import ajax from "web.ajax"; -import core from "web.core"; -import mixins from "web.mixins"; -import {setCookie} from "web.utils.cookies"; +import ajax from "@web/legacy/js/core/ajax"; +import core from "@web/legacy/js/services/core"; +import mixins from "@web/legacy/js/core/mixins"; +import {setCookie} from "@web/legacy/js/core/cookie_utils"; import { session } from "@web/session"; import { loadJS } from "@web/core/assets"; diff --git a/addons/web/static/src/legacy/js/core/session_storage.js b/addons/web/static/src/legacy/js/core/session_storage.js index 4a3179d686383..27d0c0e3a5921 100644 --- a/addons/web/static/src/legacy/js/core/session_storage.js +++ b/addons/web/static/src/legacy/js/core/session_storage.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=web.sessionStorage **/ +/** @odoo-module **/ -import RamStorage from "web.RamStorage"; -import mixins from "web.mixins"; +import RamStorage from "@web/legacy/js/core/ram_storage"; +import mixins from "@web/legacy/js/core/mixins"; // use a fake sessionStorage in RAM if the native sessionStorage is unavailable // (e.g. private browsing in Safari) @@ -14,7 +14,7 @@ try { /* * We create an intermediate object in order to triggered the storage on - * this object. the sessionStorage. This simplifies testing and usage as + * this object. the sessionStorage. This simplifies testing and usage as * starages are commutable in services without change. Also, objects * that use storage do not have to know that events go through window, * it's not up to them to handle these cases. diff --git a/addons/web/static/src/legacy/js/core/smooth_scroll_on_drag.js b/addons/web/static/src/legacy/js/core/smooth_scroll_on_drag.js index 86f6131a37010..01b15bdd3797d 100644 --- a/addons/web/static/src/legacy/js/core/smooth_scroll_on_drag.js +++ b/addons/web/static/src/legacy/js/core/smooth_scroll_on_drag.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=web.smooth_scroll_on_drag **/ +/** @odoo-module **/ -import Class from "web.Class"; -import mixins from "web.mixins"; +import Class from "@web/legacy/js/core/class"; +import mixins from "@web/legacy/js/core/mixins"; /** * Provides a helper for SmoothScrollOnDrag options.offsetElements diff --git a/addons/web/static/src/legacy/js/core/time.js b/addons/web/static/src/legacy/js/core/time.js index 422262d628023..72411b025fdf6 100644 --- a/addons/web/static/src/legacy/js/core/time.js +++ b/addons/web/static/src/legacy/js/core/time.js @@ -1,8 +1,8 @@ -/** @odoo-module alias=web.time **/ +/** @odoo-module **/ import { sprintf } from "@web/core/utils/strings"; -import translation from "web.translation"; -import utils from "web.utils"; +import translation from "@web/legacy/js/core/translation"; +import utils from "@web/legacy/js/core/utils"; var lpad = utils.lpad; var rpad = utils.rpad; @@ -21,7 +21,7 @@ var _t = translation._t; * @param {Object} v * @returns {Object} */ -function date_to_utc (k, v) { +export function date_to_utc (k, v) { var value = this[k]; if (!(value instanceof Date)) { return v; } @@ -31,14 +31,14 @@ function date_to_utc (k, v) { /** * Converts a string to a Date javascript object using OpenERP's * datetime string format (exemple: '2011-12-01 15:12:35.832'). - * + * * The time zone is assumed to be UTC (standard for OpenERP 6.1) * and will be converted to the browser's time zone. - * + * * @param {String} str A string representing a datetime. * @returns {Date} */ -function str_to_datetime (str) { +export function str_to_datetime (str) { if(!str) { return str; } @@ -65,15 +65,15 @@ function str_to_datetime (str) { /** * Converts a string to a Date javascript object using OpenERP's * date string format (exemple: '2011-12-01'). - * + * * As a date is not subject to time zones, we assume it should be * represented as a Date javascript object at 00:00:00 in the * time zone of the browser. - * + * * @param {String} str A string representing a date. * @returns {Date} */ -function str_to_date (str) { +export function str_to_date (str) { if(!str) { return str; } @@ -95,15 +95,15 @@ function str_to_date (str) { /** * Converts a string to a Date javascript object using OpenERP's * time string format (exemple: '15:12:35'). - * + * * The OpenERP times are supposed to always be naive times. We assume it is * represented using a javascript Date with a date 1 of January 1970 and a * time corresponding to the meant time in the browser's time zone. - * + * * @param {String} str A string representing a time. * @returns {Date} */ -function str_to_time (str) { +export function str_to_time (str) { if(!str) { return str; } @@ -126,14 +126,14 @@ function str_to_time (str) { /** * Converts a Date javascript object to a string using OpenERP's * datetime string format (exemple: '2011-12-01 15:12:35'). - * + * * The time zone of the Date object is assumed to be the one of the * browser and it will be converted to UTC (standard for OpenERP 6.1). - * + * * @param {Date} obj * @returns {String} A string representing a datetime. */ -function datetime_to_str (obj) { +export function datetime_to_str (obj) { if (!obj) { return false; } @@ -145,15 +145,15 @@ function datetime_to_str (obj) { /** * Converts a Date javascript object to a string using OpenERP's * date string format (exemple: '2011-12-01'). - * + * * As a date is not subject to time zones, we assume it should be * represented as a Date javascript object at 00:00:00 in the * time zone of the browser. - * + * * @param {Date} obj * @returns {String} A string representing a date. */ -function date_to_str (obj) { +export function date_to_str (obj) { if (!obj) { return false; } @@ -164,15 +164,15 @@ function date_to_str (obj) { /** * Converts a Date javascript object to a string using OpenERP's * time string format (exemple: '15:12:35'). - * + * * The OpenERP times are supposed to always be naive times. We assume it is * represented using a javascript Date with a date 1 of January 1970 and a * time corresponding to the meant time in the browser's time zone. - * + * * @param {Date} obj * @returns {String} A string representing a time. */ -function time_to_str (obj) { +export function time_to_str (obj) { if (!obj) { return false; } @@ -180,7 +180,7 @@ function time_to_str (obj) { + lpad(obj.getSeconds(),2); } -function auto_str_to_date (value) { +export function auto_str_to_date (value) { try { return str_to_datetime(value); } catch {} @@ -193,7 +193,7 @@ function auto_str_to_date (value) { throw new Error(sprintf(_t("'%s' is not a correct date, datetime nor time"), value)); } -function auto_date_to_str (value, type) { +export function auto_date_to_str (value, type) { switch(type) { case 'datetime': return datetime_to_str(value); @@ -211,7 +211,7 @@ function auto_date_to_str (value, type) { * * @param {String} value original format */ -function strftime_to_moment_format (value) { +export function strftime_to_moment_format (value) { if (_normalize_format_cache[value] === undefined) { var isletter = /[a-zA-Z]/, output = [], @@ -273,21 +273,21 @@ Object.entries(normalize_format_table).forEach(([key, val]) => { /** * Get date format of the user's language */ -function getLangDateFormat() { +export function getLangDateFormat() { return strftime_to_moment_format(_t.database.parameters.date_format); } /** * Get time format of the user's language */ -function getLangTimeFormat() { +export function getLangTimeFormat() { return strftime_to_moment_format(_t.database.parameters.time_format); } /** * Get date time format of the user's language */ -function getLangDatetimeFormat() { +export function getLangDatetimeFormat() { return strftime_to_moment_format(_t.database.parameters.date_format + " " + _t.database.parameters.time_format); } @@ -295,7 +295,7 @@ const dateFormatWoZeroCache = {}; /** * Get date format of the user's language - allows non padded */ -function getLangDateFormatWoZero() { +export function getLangDateFormatWoZero() { const dateFormat = getLangDateFormat(); if (!(dateFormat in dateFormatWoZeroCache)) { dateFormatWoZeroCache[dateFormat] = dateFormat @@ -309,7 +309,7 @@ const timeFormatWoZeroCache = {}; /** * Get time format of the user's language - allows non padded */ -function getLangTimeFormatWoZero() { +export function getLangTimeFormatWoZero() { const timeFormat = getLangTimeFormat(); if (!(timeFormat in timeFormatWoZeroCache)) { timeFormatWoZeroCache[timeFormat] = timeFormat diff --git a/addons/web/static/src/legacy/js/core/translation.js b/addons/web/static/src/legacy/js/core/translation.js index 89f29806b4b28..2ffe67fd52e71 100644 --- a/addons/web/static/src/legacy/js/core/translation.js +++ b/addons/web/static/src/legacy/js/core/translation.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=web.translation **/ +/** @odoo-module **/ -import Class from "web.Class"; +import Class from "@web/legacy/js/core/class"; import { _lt } from "@web/core/l10n/translation"; var TranslationDataBase = Class.extend(/** @lends instance.TranslationDataBase# */{ @@ -92,7 +92,7 @@ var TranslationDataBase = Class.extend(/** @lends instance.TranslationDataBase# * @param {String} source string to translate * @returns {String} source translated into the current locale */ -var _t = new TranslationDataBase().build_translation_function(); +export var _t = new TranslationDataBase().build_translation_function(); /** Setup jQuery timeago */ /* diff --git a/addons/web/static/src/legacy/js/core/utils.js b/addons/web/static/src/legacy/js/core/utils.js index 23b607320f318..b7c28722b8eeb 100644 --- a/addons/web/static/src/legacy/js/core/utils.js +++ b/addons/web/static/src/legacy/js/core/utils.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=web.utils **/ +/** @odoo-module **/ /** * Utils @@ -6,10 +6,10 @@ * Various generic utility functions */ -import translation from "web.translation"; +import translation from "@web/legacy/js/core/translation"; import { Component } from "@odoo/owl"; -import { escape, escapeHTML, escapeMethod, sprintf } from "@web/core/utils/strings"; +import { escape, escapeHTML, escapeMethod, sprintf as str_sprtinf } from "@web/core/utils/strings"; var _t = translation._t; var id = -1; @@ -284,7 +284,7 @@ class UnknownPatchError extends Error { // * Markup#replace => automatically escapes the replacements (difficult impl) // get a reference to the internalMarkup class from owl -const _Markup = owl.markup('').constructor; +const _Markup = owl.markup('').constructor; _Markup.prototype[escapeMethod] = function () { return this; } @@ -328,7 +328,7 @@ window._escape = escapeHTML; * const asis = Markup`some text`; * const h = Markup`Regular strings get ${escaped} but markup is injected ${asis}`; */ -function Markup(v, ...exprs) { +export function Markup(v, ...exprs) { if (!(v instanceof Array)) { return v ? new _Markup(v) : ''; } @@ -668,7 +668,7 @@ const utils = { return sindent + node.replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"'); } else if (typeof(node.tag) !== 'string' || node.children && !(node.children instanceof Array) || node.attrs && !(node.attrs instanceof Object)) { throw new Error( - sprintf(_t("Node [%s] is not a JSONified XML node"), + str_sprtinf(_t("Node [%s] is not a JSONified XML node"), JSON.stringify(node))); } for (var attr in node.attrs) { @@ -743,7 +743,7 @@ const utils = { * @param {string} patchName * @param {Object} patch */ - patch: function (obj, patchName, patch) { + patch:function (obj, patchName, patch) { if (!patchMap.has(obj)) { patchMap.set(obj, { original: {}, @@ -1168,4 +1168,12 @@ const utils = { }, }; +export const patch = utils.patch +export const confine = utils.confine +export const traverse = utils.traverse +export const unpatch = utils.unpatch +export const is_email = utils.is_email +export const sprintf = utils.sprintf +export const groupBy = utils.groupBy +export const sortBy = utils.sortBy export default utils; diff --git a/addons/web/static/src/legacy/js/core/widget.js b/addons/web/static/src/legacy/js/core/widget.js index 8306349450ba7..6a283fbe03a94 100644 --- a/addons/web/static/src/legacy/js/core/widget.js +++ b/addons/web/static/src/legacy/js/core/widget.js @@ -1,8 +1,8 @@ -/** @odoo-module alias=web.Widget **/ +/** @odoo-module **/ -import core from "web.core"; -import mixins from "web.mixins"; -import ServicesMixin from "web.ServicesMixin"; +import core from "@web/legacy/js/services/core"; +import mixins from "@web/legacy/js/core/mixins"; +import ServicesMixin from "@web/legacy/js/core/service_mixins"; import { loadBundle } from "@web/core/assets"; @@ -62,7 +62,7 @@ import { loadBundle } from "@web/core/assets"; * That will kill the widget in a clean way and erase its content from the dom. */ -var Widget = core.Class.extend(mixins.PropertiesMixin, ServicesMixin, { +export var Widget = core.Class.extend(mixins.PropertiesMixin, ServicesMixin, { // Backbone-ish API tagName: 'div', id: null, diff --git a/addons/web/static/src/legacy/js/env.js b/addons/web/static/src/legacy/js/env.js index c4118acb3c31e..439fe70834ad7 100644 --- a/addons/web/static/src/legacy/js/env.js +++ b/addons/web/static/src/legacy/js/env.js @@ -1,11 +1,11 @@ -/** @odoo-module alias=web.env **/ +/** @odoo-module **/ /** * This file defines the env to use in the webclient. */ -import commonEnv from 'web.commonEnv'; -import { blockUI, unblockUI } from "web.framework"; +import commonEnv from '@web/legacy/js/common_env'; +import { blockUI, unblockUI } from "@web/legacy/js/core/misc"; const env = commonEnv; env.services = Object.assign(env.services, { blockUI, unblockUI }); diff --git a/addons/web/static/src/legacy/js/fields/abstract_field.js b/addons/web/static/src/legacy/js/fields/abstract_field.js index 1377e1cee4ffc..59ddedf837477 100644 --- a/addons/web/static/src/legacy/js/fields/abstract_field.js +++ b/addons/web/static/src/legacy/js/fields/abstract_field.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=web.AbstractField **/ +/** @odoo-module **/ /** * This is the basic field widget used by all the views to render a field in a view. @@ -29,8 +29,8 @@ * @module web.AbstractField */ -import field_utils from "web.field_utils"; -import Widget from "web.Widget"; +import field_utils from "@web/legacy/js/fields/field_utils"; +import Widget from "@web/legacy/js/core/widget"; var AbstractField = Widget.extend({ events: { diff --git a/addons/web/static/src/legacy/js/fields/basic_fields.js b/addons/web/static/src/legacy/js/fields/basic_fields.js index d9c5c646c8dec..13538183e638e 100644 --- a/addons/web/static/src/legacy/js/fields/basic_fields.js +++ b/addons/web/static/src/legacy/js/fields/basic_fields.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=web.basic_fields **/ +/** @odoo-module **/ /** * This module contains most of the basic (meaning: non relational) field @@ -6,15 +6,15 @@ * BasicView, so, they can work with the records obtained from a BasicModel. */ -import AbstractField from "web.AbstractField"; -import core from "web.core"; -import datepicker from "web.datepicker"; -import dom from "web.dom"; -import framework from "web.framework"; -import py_utils from "web.py_utils"; +import AbstractField from "@web/legacy/js/fields/abstract_field"; +import core from "@web/legacy/js/services/core"; +import datepicker from "@web/legacy/js/widgets/date_picker"; +import dom from "@web/legacy/js/core/dom"; +import framework from "@web/legacy/js/core/misc"; +import py_utils from "@web/legacy/js/core/py_utils"; import session from "web.session"; -import field_utils from "web.field_utils"; -import utils from "web.utils"; +import field_utils from "@web/legacy/js/fields/field_utils"; +import utils from "@web/legacy/js/core/utils"; import { sprintf } from "@web/core/utils/strings"; import { debounce } from "@web/core/utils/timing"; import { uniqueId } from "@web/core/utils/functions"; @@ -1626,7 +1626,7 @@ var AbstractFieldBinary = AbstractField.extend({ }, }); -var FieldBinaryFile = AbstractFieldBinary.extend({ +export var FieldBinaryFile = AbstractFieldBinary.extend({ description: _lt("File"), template: 'FieldBinaryFile', events: Object.assign({}, AbstractFieldBinary.prototype.events, { diff --git a/addons/web/static/src/legacy/js/fields/field_registration.js b/addons/web/static/src/legacy/js/fields/field_registration.js index f9d5c421954b3..62e1a6100dfb5 100644 --- a/addons/web/static/src/legacy/js/fields/field_registration.js +++ b/addons/web/static/src/legacy/js/fields/field_registration.js @@ -1,9 +1,9 @@ /** @odoo-module **/ -import AbstractField from "web.AbstractField"; -import basic_fields from "web.basic_fields"; -import relational_fields from "web.relational_fields"; -import registry from "web.field_registry"; +import AbstractField from "@web/legacy/js/fields/abstract_field"; +import basic_fields from "@web/legacy/js/fields/basic_fields"; +import relational_fields from "@web/legacy/js/fields/relational_fields"; +import registry from "@web/legacy/js/fields/field_registry"; // Basic fields registry diff --git a/addons/web/static/src/legacy/js/fields/field_registry.js b/addons/web/static/src/legacy/js/fields/field_registry.js index 4275fc6da61d1..01e36992849ec 100644 --- a/addons/web/static/src/legacy/js/fields/field_registry.js +++ b/addons/web/static/src/legacy/js/fields/field_registry.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=web.field_registry **/ - - import Registry from "web.Registry"; +/** @odoo-module **/ + + import Registry from "@web/legacy/js/core/registry"; const { Component } = owl; diff --git a/addons/web/static/src/legacy/js/fields/field_utils.js b/addons/web/static/src/legacy/js/fields/field_utils.js index 0cf152b6b2ae4..5fb2661b96d03 100644 --- a/addons/web/static/src/legacy/js/fields/field_utils.js +++ b/addons/web/static/src/legacy/js/fields/field_utils.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=web.field_utils **/ +/** @odoo-module **/ /** * Field Utils @@ -15,11 +15,11 @@ */ import { escape, escapeRegExp, sprintf } from "@web/core/utils/strings"; -import core from "web.core"; -import dom from "web.dom"; +import core from "@web/legacy/js/services/core"; +import dom from "@web/legacy/js/core/dom"; import session from "web.session"; -import time from "web.time"; -import utils from "web.utils"; +import time from "@web/legacy/js/core/time"; +import utils from "@web/legacy/js/core/utils"; const { DateTime } = luxon; var _t = core._t; @@ -436,7 +436,7 @@ function formatJson(value, field, options) { /** * Smart date inputs are shortcuts to write dates quicker. * These shortcuts should respect the format ^[+-]\d+[dmwy]?$ - * + * * e.g. * "+1d" or "+1" will return now + 1 day * "-2w" will return now - 2 weeks diff --git a/addons/web/static/src/legacy/js/fields/relational_fields.js b/addons/web/static/src/legacy/js/fields/relational_fields.js index de7008f64538e..e61b7668c3d44 100644 --- a/addons/web/static/src/legacy/js/fields/relational_fields.js +++ b/addons/web/static/src/legacy/js/fields/relational_fields.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=web.relational_fields **/ +/** @odoo-module **/ /** * Relational Fields @@ -12,14 +12,14 @@ * the corresponding record(s), or alter some of their fields. */ -import AbstractField from "web.AbstractField"; -import concurrency from "web.concurrency"; -import core from "web.core"; -import Dialog from "web.Dialog"; -import dom from "web.dom"; +import AbstractField from "@web/legacy/js/fields/abstract_field"; +import concurrency from "@web/legacy/js/core/concurrency"; +import core from "@web/legacy/js/services/core"; +import Dialog from "@web/legacy/js/core/dialog"; +import dom from "@web/legacy/js/core/dom"; import { FormViewDialog } from "@web/views/view_dialogs/form_view_dialog"; import { SelectCreateDialog } from "@web/views/view_dialogs/select_create_dialog"; -import Domain from "web.Domain"; +import Domain from "@web/legacy/js/core/domain"; import { escape, sprintf } from "@web/core/utils/strings"; import { uniqueId } from "@web/core/utils/functions"; import { sortBy } from "@web/core/utils/arrays"; diff --git a/addons/web/static/src/legacy/js/libs/bootstrap.js b/addons/web/static/src/legacy/js/libs/bootstrap.js index 9cdb53ea7cd84..e8adeb1971e1e 100644 --- a/addons/web/static/src/legacy/js/libs/bootstrap.js +++ b/addons/web/static/src/legacy/js/libs/bootstrap.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=web.bootstrap.extensions **/ +/** @odoo-module **/ /** * The bootstrap library extensions and fixes should be done here to avoid diff --git a/addons/web/static/src/legacy/js/libs/content-disposition.js b/addons/web/static/src/legacy/js/libs/content-disposition.js index c26356cd27090..102743ed70936 100644 --- a/addons/web/static/src/legacy/js/libs/content-disposition.js +++ b/addons/web/static/src/legacy/js/libs/content-disposition.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=web.contentdisposition **/ +/** @odoo-module **/ /* (The MIT License) diff --git a/addons/web/static/src/legacy/js/libs/download.js b/addons/web/static/src/legacy/js/libs/download.js index 5f2cf249e366f..0f64022eaa59b 100644 --- a/addons/web/static/src/legacy/js/libs/download.js +++ b/addons/web/static/src/legacy/js/libs/download.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=web.download **/ +/** @odoo-module **/ /* MIT License diff --git a/addons/web/static/src/legacy/js/libs/pdfjs.js b/addons/web/static/src/legacy/js/libs/pdfjs.js index f1b381ba17fb5..a7d60209f33ba 100644 --- a/addons/web/static/src/legacy/js/libs/pdfjs.js +++ b/addons/web/static/src/legacy/js/libs/pdfjs.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import config from 'web.config'; +import config from '@web/legacy/js/services/config'; /** * Until we have our own implementation of the /web/static/lib/pdfjs/web/viewer.{html,js,css} @@ -48,7 +48,7 @@ display: none !important; * There is no changes to pdf.js in this section, but only a note about changes that has been done in /web/static/lib/pdfjs/. * * In the module account_invoice_extract, the code need to react to the 'pagerendered' event triggered by -* pdf.js. However in recent version of pdf.js, event are not visible outside of the library, except if the +* pdf.js. However in recent version of pdf.js, event are not visible outside of the library, except if the * 'eventBusDispatchToDOM' has been set to true. * * We tried to set this option from outside of the library but without success, as our pdf viewer is in an iframe. @@ -56,7 +56,7 @@ display: none !important; * pdf.js has an event used to signal when we can set settings, called 'webviewerloaded'. * This event is triggered in an EventListener attached to the 'DOMContentLoaded' event. * So, to list options we had, we could: -* a) add an eventListener to the iframe document or window to react to 'webviewerloaded'. This doesn't work as +* a) add an eventListener to the iframe document or window to react to 'webviewerloaded'. This doesn't work as * document and windows are not the definitive ones and won't catche the event later. * b) add an eventListener to the iframe to react to 'DOMContentLoaded', which doens't work too as our listener will be called * after the pdf.js one. diff --git a/addons/web/static/src/legacy/js/libs/zoomodoo.js b/addons/web/static/src/legacy/js/libs/zoomodoo.js index 50b5b750999c1..f8321269e3b78 100644 --- a/addons/web/static/src/legacy/js/libs/zoomodoo.js +++ b/addons/web/static/src/legacy/js/libs/zoomodoo.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=web.zoomodoo **/ +/** @odoo-module **/ /** This code has been more that widely inspired by easyZoom library. @@ -165,7 +165,7 @@ ZoomOdoo.prototype.show = function (e, testMouseOver) { } } - // Prevents the flyout to overflow + // Prevents the flyout to overflow if(left + this.$flyout.width() > $(document).width()) { this.$flyout.css('width', $(document).width() - left + 'px'); } else if(left === 0) { // Limit the max width if displayed on the left diff --git a/addons/web/static/src/legacy/js/owl_compatibility.js b/addons/web/static/src/legacy/js/owl_compatibility.js index a5b64fcccdd2f..6a255d346addb 100644 --- a/addons/web/static/src/legacy/js/owl_compatibility.js +++ b/addons/web/static/src/legacy/js/owl_compatibility.js @@ -1,5 +1,5 @@ -/** @odoo-module alias=web.OwlCompatibility **/ - +/** @odoo-module **/ + import { LegacyComponent } from "@web/legacy/legacy_component"; import { templates } from "@web/core/assets"; @@ -86,7 +86,7 @@ * } * } */ - class ComponentAdapter extends LegacyComponent { + export class ComponentAdapter extends LegacyComponent { /** * Creates the template on-the-fly, depending on the type of Component * (legacy widget or Owl component). @@ -277,7 +277,7 @@ } const bodyRef = { get el() { return document.body } }; - function standaloneAdapter(props = {}, ref = bodyRef) { + export function standaloneAdapter(props = {}, ref = bodyRef) { const env = owl.Component.env; const app = new App(null, { templates, @@ -335,7 +335,7 @@ * }, * }); */ - const WidgetAdapterMixin = { + export const WidgetAdapterMixin = { /** * Calls on_attach_callback on each child ComponentWrapper, which will * call __callMounted on each sub component (recursively), to mark them @@ -522,7 +522,7 @@ } ProxyComponent.template = xml``; - class ComponentWrapper { + export class ComponentWrapper { constructor(parent, Component, props) { if (parent instanceof Component) { throw new Error("ComponentWrapper must be used with a legacy Widget as parent"); diff --git a/addons/web/static/src/legacy/js/public/lazyloader.js b/addons/web/static/src/legacy/js/public/lazyloader.js index 5182d92bd30c8..07db5c00e2e6e 100644 --- a/addons/web/static/src/legacy/js/public/lazyloader.js +++ b/addons/web/static/src/legacy/js/public/lazyloader.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=web.public.lazyloader **/ +/** @odoo-module **/ var blockEvents = ['submit', 'click']; var blockFunction = function (ev) { diff --git a/addons/web/static/src/legacy/js/public/public_env.js b/addons/web/static/src/legacy/js/public/public_env.js index 6bb3c76da06a2..4a91d3c261de6 100644 --- a/addons/web/static/src/legacy/js/public/public_env.js +++ b/addons/web/static/src/legacy/js/public/public_env.js @@ -1,9 +1,9 @@ -/** @odoo-module alias=web.public_env **/ - +/** @odoo-module **/ + /** * This file defines the env to use in the public side. */ - import commonEnv from "web.commonEnv"; + import commonEnv from "@web/legacy/js/common_env"; export default commonEnv; 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 b72fca991e5d5..76bdd5b801d16 100644 --- a/addons/web/static/src/legacy/js/public/public_root.js +++ b/addons/web/static/src/legacy/js/public/public_root.js @@ -1,14 +1,14 @@ -/** @odoo-module alias=web.public.root */ +/** @odoo-module */ -import dom from 'web.dom'; -import legacyEnv from 'web.public_env'; +import dom from '@web/legacy/js/core/dom'; +import legacyEnv from '@web/legacy/js/public/public_env'; import session from 'web.session'; -import {getCookie} from 'web.utils.cookies'; -import publicWidget from 'web.public.widget'; +import {getCookie} from '@web/legacy/js/core/cookie_utils'; +import publicWidget from '@web/legacy/js/public/public_widget'; import { registry } from '@web/core/registry'; -import AbstractService from "web.AbstractService"; -import lazyloader from "web.public.lazyloader"; +import AbstractService from "@web/legacy/js/core/abstract_service"; +import lazyloader from "@web/legacy/js/public/lazyloader"; import { makeLegacyNotificationService, @@ -17,7 +17,7 @@ import { mapLegacyEnvToWowlEnv, makeLegacyRainbowManService, } from "../../utils"; -import { standaloneAdapter } from "web.OwlCompatibility"; +import { standaloneAdapter } from "@web/legacy/js/owl_compatibility"; import { makeEnv, startServices } from "@web/env"; import { setLoadXmlDefaultApp, loadJS, templates } from '@web/core/assets'; diff --git a/addons/web/static/src/legacy/js/public/public_widget.js b/addons/web/static/src/legacy/js/public/public_widget.js index c92d48ce7b981..f8747b644cd52 100644 --- a/addons/web/static/src/legacy/js/public/public_widget.js +++ b/addons/web/static/src/legacy/js/public/public_widget.js @@ -1,13 +1,13 @@ -/** @odoo-module alias=web.public.widget */ +/** @odoo-module */ /** * Provides a way to start JS code for public contents. */ -import dom from 'web.dom'; -import core from 'web.core'; -import mixins from 'web.mixins'; -import ServicesMixin from 'web.ServicesMixin'; +import dom from '@web/legacy/js/core/dom'; +import core from "@web/legacy/js/services/core"; +import mixins from "@web/legacy/js/core/mixins"; +import ServicesMixin from "@web/legacy/js/core/service_mixins"; import { loadBundle } from '@web/core/assets'; @@ -73,7 +73,7 @@ import { loadBundle } from '@web/core/assets'; * is loaded in the dom. * @see PublicWidget.selector */ -const PublicWidget = core.Class.extend(mixins.PropertiesMixin, ServicesMixin, { +export const PublicWidget = core.Class.extend(mixins.PropertiesMixin, ServicesMixin, { // Backbone-ish API tagName: 'div', id: null, diff --git a/addons/web/static/src/legacy/js/public/signin.js b/addons/web/static/src/legacy/js/public/signin.js index 32a742093dc2e..2d7c800935943 100644 --- a/addons/web/static/src/legacy/js/public/signin.js +++ b/addons/web/static/src/legacy/js/public/signin.js @@ -1,7 +1,7 @@ /** @odoo-module */ -import dom from 'web.dom'; -import publicWidget from 'web.public.widget'; +import dom from '@web/legacy/js/core/dom'; +import publicWidget from '@web/legacy/js/public/public_widget'; publicWidget.registry.login = publicWidget.Widget.extend({ selector: '.oe_login_form', diff --git a/addons/web/static/src/legacy/js/services/ajax_service.js b/addons/web/static/src/legacy/js/services/ajax_service.js index dfa8a04e76107..1ef4981c93b02 100644 --- a/addons/web/static/src/legacy/js/services/ajax_service.js +++ b/addons/web/static/src/legacy/js/services/ajax_service.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=web.AjaxService **/ +/** @odoo-module **/ -import AbstractService from "web.AbstractService"; -import core from "web.core"; +import AbstractService from "@web/legacy/js/core/abstract_service"; +import core from "@web/legacy/js/services/core"; import session from "web.session"; var AjaxService = AbstractService.extend({ diff --git a/addons/web/static/src/legacy/js/services/config.js b/addons/web/static/src/legacy/js/services/config.js index 9d7c3d1bd522d..1c5513a69b9af 100644 --- a/addons/web/static/src/legacy/js/services/config.js +++ b/addons/web/static/src/legacy/js/services/config.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=web.config **/ +/** @odoo-module **/ -import Bus from "web.Bus"; +import Bus from "@web/legacy/js/core/bus"; import { hasTouch, isAndroid, isIOS, isMobileOS } from "@web/core/browser/feature_detection"; import { getMediaQueryLists } from "@web/core/ui/ui_service"; diff --git a/addons/web/static/src/legacy/js/services/core.js b/addons/web/static/src/legacy/js/services/core.js index 726bbbf75286e..cb629c6563010 100644 --- a/addons/web/static/src/legacy/js/services/core.js +++ b/addons/web/static/src/legacy/js/services/core.js @@ -1,18 +1,18 @@ -/** @odoo-module alias=web.core **/ +/** @odoo-module **/ -import Bus from "web.Bus"; -import config from "web.config"; -import Class from "web.Class"; -import QWeb from "web.QWeb"; -import Registry from "web.Registry"; -import translation from "web.translation"; +import Bus from "@web/legacy/js/core/bus"; +import config from "@web/legacy/js/services/config"; +import Class from "@web/legacy/js/core/class"; +import QWeb from "@web/legacy/js/core/qweb"; +import Registry from "@web/legacy/js/core/registry"; +import translation from "@web/legacy/js/core/translation"; /** * Whether the client is currently in "debug" mode * * @type Boolean */ -var bus = new Bus(); +export var bus = new Bus(); ["click","dblclick","keydown","keypress","keyup"].forEach((evtype) => { $('html').on(evtype, function (ev) { @@ -25,19 +25,25 @@ var bus = new Bus(); }); }); +export const _t = translation._t; +export const _lt = translation._lt; +export const qweb = new QWeb(config.isDebug()); +export const serviceRegistry = new Registry(); +export const csrf_token = odoo.csrf_token; + export default { - qweb: new QWeb(config.isDebug()), + qweb: qweb, // core classes and functions Class: Class, bus: bus, - _t: translation._t, - _lt: translation._lt, + _t: _t, + _lt: _lt, // registries - serviceRegistry: new Registry(), + serviceRegistry: serviceRegistry, /** * @type {String} */ - csrf_token: odoo.csrf_token, + csrf_token: csrf_token, }; diff --git a/addons/web/static/src/legacy/js/services/local_storage_service.js b/addons/web/static/src/legacy/js/services/local_storage_service.js index 0c0d077ec1f18..eac0ad2b59c9f 100644 --- a/addons/web/static/src/legacy/js/services/local_storage_service.js +++ b/addons/web/static/src/legacy/js/services/local_storage_service.js @@ -1,12 +1,12 @@ -/** @odoo-module alias=web.LocalStorageService **/ +/** @odoo-module **/ /** * This module defines a service to access the localStorage object. */ -import AbstractStorageService from "web.AbstractStorageService"; -import core from "web.core"; -import localStorage from "web.local_storage"; +import AbstractStorageService from "@web/legacy/js/core/abstract_storage_service"; +import core from "@web/legacy/js/services/core"; +import localStorage from "@web/legacy/js/core/local_storage"; var LocalStorageService = AbstractStorageService.extend({ storage: localStorage, diff --git a/addons/web/static/src/legacy/js/services/session.js b/addons/web/static/src/legacy/js/services/session.js index 1f84524b2401b..b1f8acec67809 100644 --- a/addons/web/static/src/legacy/js/services/session.js +++ b/addons/web/static/src/legacy/js/services/session.js @@ -1,8 +1,8 @@ /** @odoo-module alias=web.session **/ -import Session from "web.Session"; +import Session from "@web/legacy/js/core/session"; var session = new Session(undefined, undefined, {use_cors: false}); -session.is_bound = session.session_bind(); +session.is_bound = session.session_bind() export default session; diff --git a/addons/web/static/src/legacy/js/services/session_storage_service.js b/addons/web/static/src/legacy/js/services/session_storage_service.js index 7a061272b870f..7815232aa936f 100644 --- a/addons/web/static/src/legacy/js/services/session_storage_service.js +++ b/addons/web/static/src/legacy/js/services/session_storage_service.js @@ -1,12 +1,12 @@ -/** @odoo-module alias=web.SessionStorageService **/ +/** @odoo-module **/ /** * This module defines a service to access the sessionStorage object. */ -import AbstractStorageService from "web.AbstractStorageService"; -import core from "web.core"; -import sessionStorage from "web.sessionStorage"; +import AbstractStorageService from "@web/legacy/js/core/abstract_storage_service"; +import core from "@web/legacy/js/services/core"; +import sessionStorage from "@web/legacy/js/core/session_storage"; var SessionStorageService = AbstractStorageService.extend({ storage: sessionStorage, diff --git a/addons/web/static/src/legacy/js/widgets/date_picker.js b/addons/web/static/src/legacy/js/widgets/date_picker.js index 5374564c17697..fa115b6195d36 100644 --- a/addons/web/static/src/legacy/js/widgets/date_picker.js +++ b/addons/web/static/src/legacy/js/widgets/date_picker.js @@ -1,9 +1,9 @@ -/** @odoo-module alias=web.datepicker **/ +/** @odoo-module **/ -import core from "web.core"; -import field_utils from "web.field_utils"; -import time from "web.time"; -import Widget from "web.Widget"; +import core from "@web/legacy/js/services/core"; +import field_utils from "@web/legacy/js/fields/field_utils"; +import time from "@web/legacy/js/core/time"; +import Widget from "@web/legacy/js/core/widget"; var _t = core._t; diff --git a/addons/web/static/src/legacy/js/widgets/name_and_signature.js b/addons/web/static/src/legacy/js/widgets/name_and_signature.js index 54d13155476d0..2d7b218f5cbdd 100644 --- a/addons/web/static/src/legacy/js/widgets/name_and_signature.js +++ b/addons/web/static/src/legacy/js/widgets/name_and_signature.js @@ -1,9 +1,9 @@ -/** @odoo-module alias=web.name_and_signature **/ +/** @odoo-module **/ -import core from "web.core"; -import config from "web.config"; -import utils from "web.utils"; -import Widget from "web.Widget"; +import core from "@web/legacy/js/services/core"; +import config from "@web/legacy/js/services/config"; +import utils from "@web/legacy/js/core/utils"; +import Widget from "@web/legacy/js/core/widget"; import { debounce } from "@web/core/utils/timing"; import { uniqueId } from "@web/core/utils/functions"; import { pick } from "@web/core/utils/objects"; @@ -14,7 +14,7 @@ import { pick } from "@web/core/utils/objects"; * Alternatively the signature can also be generated automatically based on * the given name and a selected font, or loaded from an image file. */ -var NameAndSignature = Widget.extend({ +export var NameAndSignature = Widget.extend({ template: 'web.sign_name_and_signature', events: { // name diff --git a/addons/web/static/src/legacy/legacy_dialog.js b/addons/web/static/src/legacy/legacy_dialog.js index 0200efe55d4db..bdfa6c47ea60e 100644 --- a/addons/web/static/src/legacy/legacy_dialog.js +++ b/addons/web/static/src/legacy/legacy_dialog.js @@ -2,7 +2,7 @@ import { Dialog } from "../core/dialog/dialog"; import { patch } from "@web/core/utils/patch"; -import OwlDialog from "web.OwlDialog"; +import OwlDialog from "@web/legacy/js/core/owl_dialog"; import { useEffect } from "@odoo/owl"; diff --git a/addons/web/static/src/legacy/legacy_service_provider.js b/addons/web/static/src/legacy/legacy_service_provider.js index a776135a7b87e..10494f36038aa 100644 --- a/addons/web/static/src/legacy/legacy_service_provider.js +++ b/addons/web/static/src/legacy/legacy_service_provider.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import { bus } from "web.core"; -import Context from "web.Context"; +import { bus } from "@web/legacy/js/services/core"; +import Context from "@web/legacy/js/core/context"; import { browser } from "../core/browser/browser"; import { registry } from "../core/registry"; diff --git a/addons/web/static/src/legacy/legacy_setup.js b/addons/web/static/src/legacy/legacy_setup.js index 3f8ab7843fdc7..9a4cb52342d26 100644 --- a/addons/web/static/src/legacy/legacy_setup.js +++ b/addons/web/static/src/legacy/legacy_setup.js @@ -10,9 +10,9 @@ import { makeLegacyDropdownService, } from "./utils"; import { makeLegacyActionManagerService } from "./backend_utils"; -import * as AbstractService from "web.AbstractService"; -import legacyEnv from "web.env"; -import * as session from "web.session"; +import AbstractService from "@web/legacy/js/core/abstract_service"; +import legacyEnv from "@web/legacy/js/env"; +import session from "web.session"; import { templates } from "@web/core/assets"; import { Component, whenReady } from "@odoo/owl"; diff --git a/addons/web/static/src/legacy/root_widget.js b/addons/web/static/src/legacy/root_widget.js index 56d286b99da43..4ad94ed6da76b 100644 --- a/addons/web/static/src/legacy/root_widget.js +++ b/addons/web/static/src/legacy/root_widget.js @@ -5,7 +5,7 @@ */ // need to wait for owl.Component.env to be set by web.legacySetup import "web.legacySetup"; -import { ComponentAdapter } from "web.OwlCompatibility"; +import { ComponentAdapter } from "@web/legacy/js/owl_compatibility"; // for its method _trigger_up. We can't use a standalone adapter because it // attempt to call env.isDebug which is not defined in the tests when this // module is loaded. diff --git a/addons/web/static/src/legacy/translations_loaded.js b/addons/web/static/src/legacy/translations_loaded.js index 3ecf8b038979c..a86dcf9799125 100644 --- a/addons/web/static/src/legacy/translations_loaded.js +++ b/addons/web/static/src/legacy/translations_loaded.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=web.legacy_tranlations_loaded */ +/** @odoo-module */ // this module is imported through its alias to ensure translations are loaded // before a module definition is executed, this will be insured by the odoo diff --git a/addons/web/static/src/legacy/utils.js b/addons/web/static/src/legacy/utils.js index fe5a84a899984..c8ad88ce507ce 100644 --- a/addons/web/static/src/legacy/utils.js +++ b/addons/web/static/src/legacy/utils.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { browser } from "../core/browser/browser"; -import AbstractStorageService from "web.AbstractStorageService"; +import AbstractStorageService from "@web/legacy/js/core/abstract_storage_service"; import { ConnectionAbortedError, RPCError, diff --git a/addons/web/static/src/views/pivot/pivot_renderer.js b/addons/web/static/src/views/pivot/pivot_renderer.js index 405fe2160ddec..51e44029e4e53 100644 --- a/addons/web/static/src/views/pivot/pivot_renderer.js +++ b/addons/web/static/src/views/pivot/pivot_renderer.js @@ -7,7 +7,7 @@ import { Dropdown } from "@web/core/dropdown/dropdown"; import { DropdownItem } from "@web/core/dropdown/dropdown_item"; import { formatPercentage } from "@web/views/fields/formatters"; import { PivotGroupByMenu } from "@web/views/pivot/pivot_group_by_menu"; -import fieldUtils from "web.field_utils"; +import fieldUtils from "@web/legacy/js/fields/field_utils"; import { Component, onWillUpdateProps, useRef } from "@odoo/owl"; import { download } from "@web/core/network/download"; diff --git a/addons/web/static/src/webclient/barcode/barcode_scanner.js b/addons/web/static/src/webclient/barcode/barcode_scanner.js index 497e00e3f5e27..105b16b206e49 100644 --- a/addons/web/static/src/webclient/barcode/barcode_scanner.js +++ b/addons/web/static/src/webclient/barcode/barcode_scanner.js @@ -2,8 +2,8 @@ /* global BarcodeDetector */ import { browser } from "@web/core/browser/browser"; -import Dialog from "web.OwlDialog"; -import { delay } from "web.concurrency"; +import Dialog from "@web/legacy/js/core/owl_dialog"; +import { delay } from "@web/legacy/js/core/concurrency"; import { loadJS, templates } from "@web/core/assets"; import { isVideoElementReady, buildZXingBarcodeDetector } from "./ZXingBarcodeDetector"; import { CropOverlay } from "./crop_overlay"; diff --git a/addons/web/static/src/webclient/clickbot/clickbot_loader.js b/addons/web/static/src/webclient/clickbot/clickbot_loader.js index 0b38c60b7afe3..35b9ddb82c794 100644 --- a/addons/web/static/src/webclient/clickbot/clickbot_loader.js +++ b/addons/web/static/src/webclient/clickbot/clickbot_loader.js @@ -1,14 +1,14 @@ -/** @odoo-module alias=web.clickEverywhere **/ +/** @odoo-module **/ import { loadJS } from "@web/core/assets"; import { registry } from "@web/core/registry"; -export default async function startClickEverywhere(xmlId, appsMenusOnly) { +export async function startClickEverywhere(xmlId, appsMenusOnly) { await loadJS("web/static/src/webclient/clickbot/clickbot.js"); window.clickEverywhere(xmlId, appsMenusOnly); } -function runClickTestItem({ env }) { +export function runClickTestItem({ env }) { return { type: "item", description: env._t("Run Click Everywhere Test"), @@ -19,4 +19,9 @@ function runClickTestItem({ env }) { }; } +export default { + startClickEverywhere, + runClickTestItem +} + registry.category("debug").category("default").add("runClickTestItem", runClickTestItem); diff --git a/addons/web/static/tests/core/commands/command_service_tests.js b/addons/web/static/tests/core/commands/command_service_tests.js index 45b747096676d..ac704a79c774c 100644 --- a/addons/web/static/tests/core/commands/command_service_tests.js +++ b/addons/web/static/tests/core/commands/command_service_tests.js @@ -9,7 +9,7 @@ import { dialogService } from "@web/core/dialog/dialog_service"; import { hotkeyService } from "@web/core/hotkeys/hotkey_service"; import { registry } from "@web/core/registry"; import { uiService, useActiveElement } from "@web/core/ui/ui_service"; -import testUtils from "web.test_utils"; +import testUtils from "@web/../tests/legacy/helpers/test_utils"; import { clearRegistryWithCleanup, makeTestEnv } from "../../helpers/mock_env"; import { click, diff --git a/addons/web/static/tests/core/l10n/dates_tests.js b/addons/web/static/tests/core/l10n/dates_tests.js index 515b22aeab647..ba424bdd2f719 100644 --- a/addons/web/static/tests/core/l10n/dates_tests.js +++ b/addons/web/static/tests/core/l10n/dates_tests.js @@ -13,10 +13,10 @@ import { } from "@web/core/l10n/dates"; import { localization } from "@web/core/l10n/localization"; import { patch, unpatch } from "@web/core/utils/patch"; -import core from "web.core"; -import field_utils from "web.field_utils"; +import core from "@web/legacy/js/services/core"; +import field_utils from "@web/legacy/js/fields/field_utils"; import session from "web.session"; -import test_utils from "web.test_utils"; +import test_utils from "@web/../tests/legacy/helpers/test_utils"; import { registerCleanup } from "../../helpers/cleanup"; import { defaultLocalization } from "../../helpers/mock_services"; import { patchDate, patchTimeZone, patchWithCleanup } from "../../helpers/utils"; diff --git a/addons/web/static/tests/core/utils/patch_tests.js b/addons/web/static/tests/core/utils/patch_tests.js index c7abf2b126f0c..4012d6ac505d3 100644 --- a/addons/web/static/tests/core/utils/patch_tests.js +++ b/addons/web/static/tests/core/utils/patch_tests.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { patch, unpatch } from "@web/core/utils/patch"; -import legacyUtils from "web.utils"; +import legacyUtils from "@web/legacy/js/core/utils"; function makeBaseClass(assert, assertInSetup) { class BaseClass { diff --git a/addons/web/static/tests/helpers/legacy_env_utils.js b/addons/web/static/tests/helpers/legacy_env_utils.js index 0290dd48de296..7e49fc5f79bde 100644 --- a/addons/web/static/tests/helpers/legacy_env_utils.js +++ b/addons/web/static/tests/helpers/legacy_env_utils.js @@ -5,8 +5,8 @@ import { uiService } from "@web/core/ui/ui_service"; import { patch, unpatch } from "@web/core/utils/patch"; import { makeLegacyDialogMappingService } from "@web/legacy/utils"; import { hotkeyService } from "@web/core/hotkeys/hotkey_service"; -import core from "web.core"; -import makeTestEnvironment from "web.test_env"; +import core from "@web/legacy/js/services/core"; +import makeTestEnvironment from "@web/../tests/legacy/helpers/test_env"; import { registerCleanup } from "./cleanup"; import { makeTestEnv } from "./mock_env"; diff --git a/addons/web/static/tests/helpers/session.js b/addons/web/static/tests/helpers/session.js index b861f07e076b4..59f55919c9d6c 100644 --- a/addons/web/static/tests/helpers/session.js +++ b/addons/web/static/tests/helpers/session.js @@ -8,7 +8,7 @@ // Obviously, we don't want that, ever. import { session as sessionInfo } from "@web/session"; const initialSessionInfo = Object.assign({}, sessionInfo); -import Session from "web.Session"; +import Session from "@web/legacy/js/core/session"; import { patch } from "@web/core/utils/patch"; patch(Session.prototype, "web.SessionTestPatch", { diff --git a/addons/web/static/tests/legacy/component_extension_tests.js b/addons/web/static/tests/legacy/component_extension_tests.js index d025cb3415bb3..e69d5c8ab8d8c 100644 --- a/addons/web/static/tests/legacy/component_extension_tests.js +++ b/addons/web/static/tests/legacy/component_extension_tests.js @@ -1,7 +1,7 @@ /** @odoo-module **/ - - import makeTestEnvironment from "web.test_env"; - import testUtils from "web.test_utils"; + + import makeTestEnvironment from "@web/../tests/legacy/helpers/test_env"; + import testUtils from "@web/../tests/legacy/helpers/test_utils"; import { destroy, getFixture, mount } from "@web/../tests/helpers/utils"; import { LegacyComponent } from "@web/legacy/legacy_component"; diff --git a/addons/web/static/tests/legacy/core/class_tests.js b/addons/web/static/tests/legacy/core/class_tests.js index 9a2ad898963fd..4292a54e5f7ba 100644 --- a/addons/web/static/tests/legacy/core/class_tests.js +++ b/addons/web/static/tests/legacy/core/class_tests.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import Class from "web.Class"; +import Class from "@web/legacy/js/core/class"; QUnit.module('core', {}, function () { diff --git a/addons/web/static/tests/legacy/core/concurrency_tests.js b/addons/web/static/tests/legacy/core/concurrency_tests.js index 7b1b24bad4f20..e98865d8a9d39 100644 --- a/addons/web/static/tests/legacy/core/concurrency_tests.js +++ b/addons/web/static/tests/legacy/core/concurrency_tests.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import concurrency from "web.concurrency"; -import testUtils from "web.test_utils"; +import concurrency from "@web/legacy/js/core/concurrency"; +import testUtils from "@web/../tests/legacy/helpers/test_utils"; var makeTestPromise = testUtils.makeTestPromise; var makeTestPromiseWithAssert = testUtils.makeTestPromiseWithAssert; diff --git a/addons/web/static/tests/legacy/core/dialog_tests.js b/addons/web/static/tests/legacy/core/dialog_tests.js index 0696719b02b32..e1200c4712e1e 100644 --- a/addons/web/static/tests/legacy/core/dialog_tests.js +++ b/addons/web/static/tests/legacy/core/dialog_tests.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import Dialog from "web.Dialog"; -import testUtils from "web.test_utils"; -import Widget from "web.Widget"; +import Dialog from "@web/legacy/js/core/dialog"; +import testUtils from "@web/../tests/legacy/helpers/test_utils"; +import Widget from "@web/legacy/js/core/widget"; var ESCAPE_KEY = $.Event("keyup", { which: 27 }); diff --git a/addons/web/static/tests/legacy/core/dom_tests.js b/addons/web/static/tests/legacy/core/dom_tests.js index 9d5d3048505a9..80828874caae9 100644 --- a/addons/web/static/tests/legacy/core/dom_tests.js +++ b/addons/web/static/tests/legacy/core/dom_tests.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import dom from "web.dom"; -import testUtils from "web.test_utils"; +import dom from "@web/legacy/js/core/dom"; +import testUtils from "@web/../tests/legacy/helpers/test_utils"; /** * Create an autoresize text area with 'border-box' as box sizing rule. diff --git a/addons/web/static/tests/legacy/core/domain_tests.js b/addons/web/static/tests/legacy/core/domain_tests.js index 52df7d8c52490..362f3c08b922f 100644 --- a/addons/web/static/tests/legacy/core/domain_tests.js +++ b/addons/web/static/tests/legacy/core/domain_tests.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import Domain from "web.Domain"; +import Domain from "@web/legacy/js/core/domain"; QUnit.module('core', {}, function () { diff --git a/addons/web/static/tests/legacy/core/mixins_tests.js b/addons/web/static/tests/legacy/core/mixins_tests.js index 079b64c7409ae..1c55691caa0b4 100644 --- a/addons/web/static/tests/legacy/core/mixins_tests.js +++ b/addons/web/static/tests/legacy/core/mixins_tests.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import testUtils from "web.test_utils"; -import Widget from "web.Widget"; +import testUtils from "@web/../tests/legacy/helpers/test_utils"; +import Widget from "@web/legacy/js/core/widget"; QUnit.module('core', {}, function () { diff --git a/addons/web/static/tests/legacy/core/owl_dialog_tests.js b/addons/web/static/tests/legacy/core/owl_dialog_tests.js index 13ee3a37beba1..4a6c1d10d5d78 100644 --- a/addons/web/static/tests/legacy/core/owl_dialog_tests.js +++ b/addons/web/static/tests/legacy/core/owl_dialog_tests.js @@ -1,9 +1,9 @@ /** @odoo-module **/ - - import LegacyDialog from "web.Dialog"; - import makeTestEnvironment from "web.test_env"; - import Dialog from "web.OwlDialog"; - import testUtils from "web.test_utils"; + + import LegacyDialog from "@web/legacy/js/core/dialog"; + import makeTestEnvironment from "@web/../tests/legacy/helpers/test_env"; + import Dialog from "@web/legacy/js/core/owl_dialog"; + import testUtils from "@web/../tests/legacy/helpers/test_utils"; import { makeLegacyDialogMappingTestEnv } from "@web/../tests/helpers/legacy_env_utils"; import { Dialog as WowlDialog } from "@web/core/dialog/dialog"; diff --git a/addons/web/static/tests/legacy/core/patch_tests.js b/addons/web/static/tests/legacy/core/patch_tests.js index 13b6405e3196f..94ecb327aab76 100644 --- a/addons/web/static/tests/legacy/core/patch_tests.js +++ b/addons/web/static/tests/legacy/core/patch_tests.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import { AlreadyDefinedPatchError, patch, unpatch, UnknownPatchError } from "web.utils"; +import _utils from "@web/legacy/js/core/utils"; function makeBaseClass(assert, assertInSetup) { class BaseClass { @@ -51,7 +51,7 @@ QUnit.module('core', {}, function () { const BaseClass = makeBaseClass(assert); - patch(BaseClass.prototype, 'patch', { + _utils.patch(BaseClass.prototype, 'patch', { setup() { this._super(); assert.step('patch.setup'); @@ -77,7 +77,7 @@ QUnit.module('core', {}, function () { const BaseClass = makeBaseClass(assert); - patch(BaseClass.prototype, 'patch1', { + _utils.patch(BaseClass.prototype, 'patch1', { setup() { this._super(); assert.step('patch1.setup'); @@ -88,7 +88,7 @@ QUnit.module('core', {}, function () { }, }); - patch(BaseClass.prototype, 'patch2', { + _utils.patch(BaseClass.prototype, 'patch2', { setup() { this._super(); assert.step('patch2.setup'); @@ -116,12 +116,12 @@ QUnit.module('core', {}, function () { const A = class {}; - patch(A.prototype, 'patch'); + _utils.patch(A.prototype, 'patch'); // keys should be unique assert.throws(() => { - patch(A.prototype, 'patch'); - }, AlreadyDefinedPatchError); + _utils.patch(A.prototype, 'patch'); + }, _utils.AlreadyDefinedPatchError); }); QUnit.test('unpatch', async function (assert) { @@ -129,7 +129,7 @@ QUnit.module('core', {}, function () { const BaseClass = makeBaseClass(assert); - patch(BaseClass.prototype, 'patch', { + _utils.patch(BaseClass.prototype, 'patch', { setup() { this._super(); assert.step('patch.setup'); @@ -149,7 +149,7 @@ QUnit.module('core', {}, function () { 'patch.fn', ]); - unpatch(BaseClass.prototype, 'patch'); + _utils.unpatch(BaseClass.prototype, 'patch'); (new BaseClass()).fn(); @@ -164,7 +164,7 @@ QUnit.module('core', {}, function () { const BaseClass = makeBaseClass(assert); - patch(BaseClass.prototype, 'patch1', { + _utils.patch(BaseClass.prototype, 'patch1', { setup() { this._super(); assert.step('patch1.setup'); @@ -175,7 +175,7 @@ QUnit.module('core', {}, function () { }, }); - patch(BaseClass.prototype, 'patch2', { + _utils.patch(BaseClass.prototype, 'patch2', { setup() { this._super(); assert.step('patch2.setup'); @@ -197,7 +197,7 @@ QUnit.module('core', {}, function () { 'patch2.fn', ]); - unpatch(BaseClass.prototype, 'patch1'); + _utils.unpatch(BaseClass.prototype, 'patch1'); (new BaseClass()).fn(); @@ -208,7 +208,7 @@ QUnit.module('core', {}, function () { 'patch2.fn', ]); - unpatch(BaseClass.prototype, 'patch2'); + _utils.unpatch(BaseClass.prototype, 'patch2'); (new BaseClass()).fn(); @@ -223,7 +223,7 @@ QUnit.module('core', {}, function () { const BaseClass = makeBaseClass(assert); - patch(BaseClass.prototype, 'patch1', { + _utils.patch(BaseClass.prototype, 'patch1', { setup() { this._super(); assert.step('patch1.setup'); @@ -234,7 +234,7 @@ QUnit.module('core', {}, function () { }, }); - patch(BaseClass.prototype, 'patch2', { + _utils.patch(BaseClass.prototype, 'patch2', { setup() { this._super(); assert.step('patch2.setup'); @@ -256,7 +256,7 @@ QUnit.module('core', {}, function () { 'patch2.fn', ]); - unpatch(BaseClass.prototype, 'patch1'); + _utils.unpatch(BaseClass.prototype, 'patch1'); (new BaseClass()).fn(); @@ -267,7 +267,7 @@ QUnit.module('core', {}, function () { 'patch2.fn', ]); - unpatch(BaseClass.prototype, 'patch2'); + _utils.unpatch(BaseClass.prototype, 'patch2'); (new BaseClass()).fn(); @@ -282,20 +282,20 @@ QUnit.module('core', {}, function () { const A = class {}; assert.throws(() => { - unpatch(A.prototype, 'patch'); - }, UnknownPatchError); + _utils.unpatch(A.prototype, 'patch'); + }, _utils.UnknownPatchError); }); QUnit.test('unpatch twice the same patch name', async function (assert) { assert.expect(1); const A = class {}; - patch(A.prototype, 'patch'); + _utils.patch(A.prototype, 'patch'); - unpatch(A.prototype, 'patch'); + _utils.unpatch(A.prototype, 'patch'); assert.throws(() => { - unpatch(A.prototype, 'patch'); - }, UnknownPatchError); + _utils.unpatch(A.prototype, 'patch'); + }, _utils.UnknownPatchError); }); QUnit.test('unpatch and re-patch', async function (assert) { @@ -303,7 +303,7 @@ QUnit.module('core', {}, function () { const BaseClass = makeBaseClass(assert); - patch(BaseClass.prototype, 'patch', { + _utils.patch(BaseClass.prototype, 'patch', { setup() { this._super(); assert.step('patch.setup'); @@ -323,7 +323,7 @@ QUnit.module('core', {}, function () { 'patch.fn', ]); - const p = unpatch(BaseClass.prototype, 'patch'); + const p =_utils.unpatch(BaseClass.prototype, 'patch'); (new BaseClass()).fn(); @@ -332,7 +332,7 @@ QUnit.module('core', {}, function () { 'base.fn', ]); - patch(BaseClass.prototype, 'patch', p); + _utils.patch(BaseClass.prototype, 'patch', p); (new BaseClass()).fn(); @@ -358,7 +358,7 @@ QUnit.module('core', {}, function () { } }; - patch(A.prototype, 'patch', { + _utils.patch(A.prototype, 'patch', { setup() { this._super('patch', ...arguments); }, @@ -373,7 +373,7 @@ QUnit.module('core', {}, function () { assert.expect(3); const BaseClass = makeBaseClass(assert, false); - patch(BaseClass.prototype, 'patch', { + _utils.patch(BaseClass.prototype, 'patch', { setup() { this._super(...arguments); @@ -396,7 +396,7 @@ QUnit.module('core', {}, function () { assert.notOk((new BaseClass()).f); - patch(BaseClass.prototype, 'patch', { + _utils.patch(BaseClass.prototype, 'patch', { f() { assert.step('patch.f'); }, @@ -405,7 +405,7 @@ QUnit.module('core', {}, function () { (new BaseClass()).f(); assert.verifySteps(['patch.f']); - unpatch(BaseClass.prototype, 'patch'); + _utils.unpatch(BaseClass.prototype, 'patch'); assert.notOk((new BaseClass()).f); }); @@ -418,7 +418,7 @@ QUnit.module('core', {}, function () { BaseClass.staticFn(); assert.verifySteps(['base.staticFn']); - patch(BaseClass, 'patch', { + _utils.patch(BaseClass, 'patch', { staticFn() { this._super(); assert.step('patch.staticFn'); @@ -428,7 +428,7 @@ QUnit.module('core', {}, function () { BaseClass.staticFn(); assert.verifySteps(['base.staticFn', 'patch.staticFn']); - unpatch(BaseClass, 'patch'); + _utils.unpatch(BaseClass, 'patch'); BaseClass.staticFn(); assert.verifySteps(['base.staticFn']); @@ -439,7 +439,7 @@ QUnit.module('core', {}, function () { const BaseClass = makeBaseClass(assert); - patch(BaseClass, 'patch', { + _utils.patch(BaseClass, 'patch', { staticStr: BaseClass.staticStr + 'patch', staticArr: [...BaseClass.staticArr, 'patch'], staticObj: {...BaseClass.staticObj, patch: 'patch'}, @@ -449,7 +449,7 @@ QUnit.module('core', {}, function () { assert.deepEqual(BaseClass.staticArr, ['base', 'patch']); assert.deepEqual(BaseClass.staticObj, { base: 'base', patch: 'patch' }); - unpatch(BaseClass, 'patch'); + _utils.unpatch(BaseClass, 'patch'); assert.strictEqual(BaseClass.staticStr, 'base'); assert.deepEqual(BaseClass.staticArr, ['base']); @@ -462,7 +462,7 @@ QUnit.module('core', {}, function () { const BaseClass = makeBaseClass(assert); const instance = new BaseClass(); - patch(BaseClass.prototype, 'patch', { + _utils.patch(BaseClass.prototype, 'patch', { setup() { this._super(); // will not be called @@ -481,7 +481,7 @@ QUnit.module('core', {}, function () { 'patch.fn', ]); - unpatch(BaseClass.prototype, 'patch'); + _utils.unpatch(BaseClass.prototype, 'patch'); instance.fn(); assert.verifySteps([ @@ -494,7 +494,7 @@ QUnit.module('core', {}, function () { const BaseClass = makeBaseClass(assert, false); - patch(BaseClass.prototype, 'patch', { + _utils.patch(BaseClass.prototype, 'patch', { get dynamic() { return this._super() + 'patch'; }, @@ -503,7 +503,7 @@ QUnit.module('core', {}, function () { const instance = new BaseClass(); assert.strictEqual(instance.dynamic, 'basepatch'); - unpatch(BaseClass.prototype, 'patch'); + _utils.unpatch(BaseClass.prototype, 'patch'); assert.strictEqual(instance.dynamic, 'base'); }); @@ -512,7 +512,7 @@ QUnit.module('core', {}, function () { const BaseClass = makeBaseClass(assert, false); - patch(BaseClass.prototype, 'patch', { + _utils.patch(BaseClass.prototype, 'patch', { set dynamic(value) { this._super('patch:' + value); }, @@ -524,7 +524,7 @@ QUnit.module('core', {}, function () { instance.dynamic = 'patch'; assert.strictEqual(instance.dynamic, 'patch:patch'); - unpatch(BaseClass.prototype, 'patch'); + _utils.unpatch(BaseClass.prototype, 'patch'); instance.dynamic = 'base'; assert.strictEqual(instance.dynamic, 'base'); @@ -535,7 +535,7 @@ QUnit.module('core', {}, function () { const BaseClass = makeBaseClass(assert, false); - patch(BaseClass.prototype, "patch", { + _utils.patch(BaseClass.prototype, "patch", { async asyncFn() { const _super = this._super; await Promise.resolve(); @@ -559,7 +559,7 @@ QUnit.module('core', {}, function () { const BaseClass = makeBaseClass(assert, false); - patch(BaseClass.prototype, "patch1", { + _utils.patch(BaseClass.prototype, "patch1", { async asyncFn() { const _super = this._super; await Promise.resolve(); @@ -568,7 +568,7 @@ QUnit.module('core', {}, function () { assert.step(`patch1.${this.str}`); }, }); - patch(BaseClass.prototype, "patch2", { + _utils.patch(BaseClass.prototype, "patch2", { async asyncFn() { const _super = this._super; await Promise.resolve(); @@ -615,7 +615,7 @@ QUnit.module('core', {}, function () { 'extension.fn', ]); - patch(BaseClass.prototype, 'patch', { + _utils.patch(BaseClass.prototype, 'patch', { setup() { this._super(); assert.step('patch.setup'); @@ -642,7 +642,7 @@ QUnit.module('core', {}, function () { const BaseClass = makeBaseClass(assert); - patch(BaseClass.prototype, 'patch', { + _utils.patch(BaseClass.prototype, 'patch', { setup() { this._super(); assert.step('patch.setup'); @@ -700,7 +700,7 @@ QUnit.module('core', {}, function () { 'extension.fn', ]); - patch(Extension.prototype, 'patch', { + _utils.patch(Extension.prototype, 'patch', { setup() { this._super(); assert.step('patch.setup'); @@ -727,7 +727,7 @@ QUnit.module('core', {}, function () { const BaseClass = makeBaseClass(assert); - patch(BaseClass.prototype, 'patch', { + _utils.patch(BaseClass.prototype, 'patch', { setup() { this._super(); assert.step('patch.setup'); @@ -749,7 +749,7 @@ QUnit.module('core', {}, function () { } } - patch(Extension.prototype, 'patch', { + _utils.patch(Extension.prototype, 'patch', { setup() { this._super(); assert.step('patch.extension.setup'); @@ -789,7 +789,7 @@ QUnit.module('core', {}, function () { } } - patch(BaseClass.prototype, 'patch', { + _utils.patch(BaseClass.prototype, 'patch', { setup() { this._super(); assert.step('patch.setup'); @@ -810,7 +810,7 @@ QUnit.module('core', {}, function () { 'extension.fn', ]); - unpatch(BaseClass.prototype, 'patch'); + _utils.unpatch(BaseClass.prototype, 'patch'); (new Extension()).fn(); assert.verifySteps([ @@ -837,7 +837,7 @@ QUnit.module('core', {}, function () { } } - patch(Extension.prototype, 'patch', { + _utils.patch(Extension.prototype, 'patch', { setup() { this._super(); assert.step('patch.setup'); @@ -858,7 +858,7 @@ QUnit.module('core', {}, function () { 'patch.fn', ]); - unpatch(Extension.prototype, 'patch'); + _utils.unpatch(Extension.prototype, 'patch'); (new Extension()).fn(); assert.verifySteps([ @@ -874,7 +874,7 @@ QUnit.module('core', {}, function () { const BaseClass = makeBaseClass(assert); - patch(BaseClass.prototype, 'patch.BaseClass', { + _utils.patch(BaseClass.prototype, 'patch.BaseClass', { setup() { this._super(); assert.step('patch.setup'); @@ -896,7 +896,7 @@ QUnit.module('core', {}, function () { } } - patch(Extension.prototype, 'patch.Extension', { + _utils.patch(Extension.prototype, 'patch.Extension', { setup() { this._super(); assert.step('patch.extension.setup'); @@ -919,7 +919,7 @@ QUnit.module('core', {}, function () { 'patch.extension.fn', ]); - unpatch(BaseClass.prototype, 'patch.BaseClass'); + _utils.unpatch(BaseClass.prototype, 'patch.BaseClass'); (new Extension()).fn(); assert.verifySteps([ @@ -931,7 +931,7 @@ QUnit.module('core', {}, function () { 'patch.extension.fn', ]); - unpatch(Extension.prototype, 'patch.Extension'); + _utils.unpatch(Extension.prototype, 'patch.Extension'); (new Extension()).fn(); assert.verifySteps([ @@ -947,7 +947,7 @@ QUnit.module('core', {}, function () { const BaseClass = makeBaseClass(assert); - patch(BaseClass.prototype, 'patch.BaseClass', { + _utils.patch(BaseClass.prototype, 'patch.BaseClass', { setup() { this._super(); assert.step('patch.setup'); @@ -969,7 +969,7 @@ QUnit.module('core', {}, function () { } } - patch(Extension.prototype, 'patch.Extension', { + _utils.patch(Extension.prototype, 'patch.Extension', { setup() { this._super(); assert.step('patch.extension.setup'); @@ -992,7 +992,7 @@ QUnit.module('core', {}, function () { 'patch.extension.fn', ]); - unpatch(Extension.prototype, 'patch.Extension'); + _utils.unpatch(Extension.prototype, 'patch.Extension'); (new Extension()).fn(); assert.verifySteps([ @@ -1004,7 +1004,7 @@ QUnit.module('core', {}, function () { 'extension.fn', ]); - unpatch(BaseClass.prototype, 'patch.BaseClass'); + _utils.unpatch(BaseClass.prototype, 'patch.BaseClass'); (new Extension()).fn(); assert.verifySteps([ @@ -1027,14 +1027,14 @@ QUnit.module('core', {}, function () { } } - patch(BaseClass, 'patch.BaseClass', { + _utils.patch(BaseClass, 'patch.BaseClass', { staticFn() { this._super(); assert.step('patch.staticFn'); } }); - patch(Extension, 'patch.Extension', { + _utils.patch(Extension, 'patch.Extension', { staticFn() { this._super(); assert.step('patch.extension.staticFn'); @@ -1049,7 +1049,7 @@ QUnit.module('core', {}, function () { 'patch.extension.staticFn', ]); - unpatch(BaseClass, 'patch.BaseClass'); + _utils.unpatch(BaseClass, 'patch.BaseClass'); Extension.staticFn(); assert.verifySteps([ @@ -1058,7 +1058,7 @@ QUnit.module('core', {}, function () { 'patch.extension.staticFn', ]); - unpatch(Extension, 'patch.Extension'); + _utils.unpatch(Extension, 'patch.Extension'); Extension.staticFn(); assert.verifySteps([ @@ -1072,7 +1072,7 @@ QUnit.module('core', {}, function () { const BaseClass = makeBaseClass(assert); - patch(BaseClass, 'patch.BaseClass', { + _utils.patch(BaseClass, 'patch.BaseClass', { staticStr: BaseClass.staticStr + 'patch', staticArr: [...BaseClass.staticArr, 'patch'], staticObj: {...BaseClass.staticObj, patch: 'patch'}, @@ -1088,7 +1088,7 @@ QUnit.module('core', {}, function () { assert.deepEqual(Extension.staticObj, { base: 'base', patch: 'patch', extension: 'extension' }); - unpatch(BaseClass, 'patch.BaseClass'); + _utils.unpatch(BaseClass, 'patch.BaseClass'); // /!\ WARNING /!\ // If inherit comes after the patch then extension will still have @@ -1112,7 +1112,7 @@ QUnit.module('core', {}, function () { // /!\ WARNING /!\ // If patch comes after the inherit then extension won't have // the patched data. - patch(BaseClass, 'patch.BaseClass', { + _utils.patch(BaseClass, 'patch.BaseClass', { staticStr: BaseClass.staticStr + 'patch', staticArr: [...BaseClass.staticArr, 'patch'], staticObj: {...BaseClass.staticObj, patch: 'patch'}, @@ -1123,7 +1123,7 @@ QUnit.module('core', {}, function () { assert.deepEqual(Extension.staticObj, { base: 'base', extension: 'extension' }); - unpatch(BaseClass, 'patch.BaseClass'); + _utils.unpatch(BaseClass, 'patch.BaseClass'); assert.strictEqual(Extension.staticStr, 'baseextension'); assert.deepEqual(Extension.staticArr, ['base', 'extension']); @@ -1148,7 +1148,7 @@ QUnit.module('core', {}, function () { const instance = new Extension(); - patch(BaseClass.prototype, 'patch', { + _utils.patch(BaseClass.prototype, 'patch', { setup() { this._super(); // will not be called @@ -1169,7 +1169,7 @@ QUnit.module('core', {}, function () { 'extension.fn', ]); - unpatch(BaseClass.prototype, 'patch'); + _utils.unpatch(BaseClass.prototype, 'patch'); instance.fn(); assert.verifySteps([ @@ -1190,7 +1190,7 @@ QUnit.module('core', {}, function () { }, }; - patch(obj, "patch", { + _utils.patch(obj, "patch", { var: obj.var + "patch", fn() { this._super(...arguments); @@ -1203,7 +1203,7 @@ QUnit.module('core', {}, function () { obj.fn(); assert.verifySteps([ "obj", "patch" ]); - unpatch(obj, "patch"); + _utils.unpatch(obj, "patch"); assert.strictEqual(obj.var, "obj"); diff --git a/addons/web/static/tests/legacy/core/popover_tests.js b/addons/web/static/tests/legacy/core/popover_tests.js index 83fdfc9f48e2e..6a8c9c4b20f80 100644 --- a/addons/web/static/tests/legacy/core/popover_tests.js +++ b/addons/web/static/tests/legacy/core/popover_tests.js @@ -1,8 +1,8 @@ /** @odoo-module **/ - - import makeTestEnvironment from "web.test_env"; - import Popover from "web.Popover"; - import testUtils from "web.test_utils"; + + import makeTestEnvironment from "@web/../tests/legacy/helpers/test_env"; + import Popover from "@web/legacy/js/core/popover"; + import testUtils from "@web/../tests/legacy/helpers/test_utils"; import { click, getFixture, mount } from "@web/../tests/helpers/utils"; import { LegacyComponent } from "@web/legacy/legacy_component"; diff --git a/addons/web/static/tests/legacy/core/py_utils_tests.js b/addons/web/static/tests/legacy/core/py_utils_tests.js index ccaf1f7fe029d..64463f18fe6b6 100644 --- a/addons/web/static/tests/legacy/core/py_utils_tests.js +++ b/addons/web/static/tests/legacy/core/py_utils_tests.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import Context from "web.Context"; -import pyUtils from "web.py_utils"; -import time from "web.time"; +import Context from "@web/legacy/js/core/context"; +import pyUtils from "@web/legacy/js/core/py_utils"; +import time from "@web/legacy/js/core/time"; const r = String.raw; diff --git a/addons/web/static/tests/legacy/core/registry_tests.js b/addons/web/static/tests/legacy/core/registry_tests.js index 51fe074bc9f91..ae55ff99feefb 100644 --- a/addons/web/static/tests/legacy/core/registry_tests.js +++ b/addons/web/static/tests/legacy/core/registry_tests.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import Registry from "web.Registry"; +import Registry from "@web/legacy/js/core/registry"; QUnit.module('core', {}, function () { diff --git a/addons/web/static/tests/legacy/core/rpc_tests.js b/addons/web/static/tests/legacy/core/rpc_tests.js index 25f71a1677a1d..afc9054dc80fa 100644 --- a/addons/web/static/tests/legacy/core/rpc_tests.js +++ b/addons/web/static/tests/legacy/core/rpc_tests.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import rpc from "web.rpc"; +import rpc from "@web/legacy/js/core/rpc"; QUnit.module('core', {}, function () { diff --git a/addons/web/static/tests/legacy/core/time_tests.js b/addons/web/static/tests/legacy/core/time_tests.js index e4b5bb6ed7538..15998790e4b40 100644 --- a/addons/web/static/tests/legacy/core/time_tests.js +++ b/addons/web/static/tests/legacy/core/time_tests.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import core from "web.core"; -import time from "web.time"; +import core from "@web/legacy/js/services/core"; +import time from "@web/legacy/js/core/time"; QUnit.module('core', {}, function () { diff --git a/addons/web/static/tests/legacy/core/util_tests.js b/addons/web/static/tests/legacy/core/util_tests.js index 3288d0e0a53b5..2d8f40351377f 100644 --- a/addons/web/static/tests/legacy/core/util_tests.js +++ b/addons/web/static/tests/legacy/core/util_tests.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import utils from "web.utils"; +import utils from "@web/legacy/js/core/utils"; import { getDataURLFromFile } from "@web/core/utils/urls"; QUnit.module('core', {}, function () { diff --git a/addons/web/static/tests/legacy/core/widget_tests.js b/addons/web/static/tests/legacy/core/widget_tests.js index b14f608d987fa..5996dba78cf0b 100644 --- a/addons/web/static/tests/legacy/core/widget_tests.js +++ b/addons/web/static/tests/legacy/core/widget_tests.js @@ -1,11 +1,11 @@ /** @odoo-module **/ -import AjaxService from "web.AjaxService"; -import core from "web.core"; -import Dialog from "web.Dialog"; -import QWeb from "web.QWeb"; -import Widget from "web.Widget"; -import testUtils from "web.test_utils"; +import AjaxService from "@web/legacy/js/services/ajax_service"; +import core from "@web/legacy/js/services/core"; +import Dialog from "@web/legacy/js/core/dialog"; +import QWeb from "@web/legacy/js/core/qweb"; +import Widget from "@web/legacy/js/core/widget"; +import testUtils from "@web/../tests/legacy/helpers/test_utils"; QUnit.module('core', {}, function () { diff --git a/addons/web/static/tests/legacy/frontend/keyboard_navigation_mixin_tests.js b/addons/web/static/tests/legacy/frontend/keyboard_navigation_mixin_tests.js index c3b5469b66b8b..a22120ac0728b 100644 --- a/addons/web/static/tests/legacy/frontend/keyboard_navigation_mixin_tests.js +++ b/addons/web/static/tests/legacy/frontend/keyboard_navigation_mixin_tests.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import KeyboardNavigationMixin from "web.KeyboardNavigationMixin"; -import testUtils from "web.test_utils"; -import Widget from "web.Widget"; +import KeyboardNavigationMixin from "@web/legacy/frontend/keyboard_navigation_mixin"; +import testUtils from "@web/../tests/legacy/helpers/test_utils"; +import Widget from "@web/legacy/js/core/widget"; QUnit.module('KeyboardNavigationMixin', function () { QUnit.test('aria-keyshortcuts is added on elements with accesskey', async function (assert) { diff --git a/addons/web/static/tests/legacy/helpers/mock_server.js b/addons/web/static/tests/legacy/helpers/mock_server.js index f413f100af586..0436d67a0a392 100644 --- a/addons/web/static/tests/legacy/helpers/mock_server.js +++ b/addons/web/static/tests/legacy/helpers/mock_server.js @@ -1,16 +1,16 @@ -/** @odoo-module alias=web.MockServer **/ +/** @odoo-module **/ import { unique } from "@web/core/utils/arrays"; import { pick } from "@web/core/utils/objects"; -import Class from "web.Class"; -import Domain from "web.Domain"; -import pyUtils from "web.py_utils"; -import { - parseDateTime, - serializeDate, - serializeDateTime, - deserializeDate, - deserializeDateTime +import Class from "@web/legacy/js/core/class"; +import Domain from "@web/legacy/js/core/domain"; +import pyUtils from "@web/legacy/js/core/py_utils"; +import { + parseDateTime, + serializeDate, + serializeDateTime, + deserializeDate, + deserializeDateTime } from "@web/core/l10n/dates"; var MockServer = Class.extend({ @@ -2093,7 +2093,7 @@ var MockServer = Class.extend({ * helper function: traverse a tree and apply the function f to each of its * nodes. * - * Note: this should be abstracted somewhere in web.utils, or in + * Note: this should be abstracted somewhere in @web/legacy/js/core/utils, or in * web.tree_utils * * @param {Object} tree object with a 'children' key, which contains an diff --git a/addons/web/static/tests/legacy/helpers/test_env.js b/addons/web/static/tests/legacy/helpers/test_env.js index 64634b3d1a18d..bdb820ec7f465 100644 --- a/addons/web/static/tests/legacy/helpers/test_env.js +++ b/addons/web/static/tests/legacy/helpers/test_env.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=web.test_env **/ - - import Bus from "web.Bus"; +/** @odoo-module **/ + + import Bus from "@web/legacy/js/core/bus"; import session from "web.session"; import { makeTestEnvServices } from "@web/../tests/legacy/helpers/test_services"; import { templates, setLoadXmlDefaultApp } from "@web/core/assets"; diff --git a/addons/web/static/tests/legacy/helpers/test_services.js b/addons/web/static/tests/legacy/helpers/test_services.js index 5bcafb7cfddc1..25c5d528d4a74 100644 --- a/addons/web/static/tests/legacy/helpers/test_services.js +++ b/addons/web/static/tests/legacy/helpers/test_services.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import { buildQuery } from 'web.rpc'; +import { buildQuery } from '@web/legacy/js/core/rpc'; const testEnvServices = { getCookie() {}, diff --git a/addons/web/static/tests/legacy/helpers/test_utils.js b/addons/web/static/tests/legacy/helpers/test_utils.js index ca1c1723304ac..1625703481323 100644 --- a/addons/web/static/tests/legacy/helpers/test_utils.js +++ b/addons/web/static/tests/legacy/helpers/test_utils.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=web.test_utils **/ +/** @odoo-module **/ /** * Test Utils @@ -7,11 +7,11 @@ * environment as close as possible as a real environment. */ - import testUtilsDom from "web.test_utils_dom"; - import testUtilsFields from "web.test_utils_fields"; - import testUtilsFile from "web.test_utils_file"; - import testUtilsMock from "web.test_utils_mock"; - import Widget from "web.Widget"; + import testUtilsDom from "@web/../tests/legacy/helpers/test_utils_dom"; + import testUtilsFields from "@web/../tests/legacy/helpers/test_utils_fields"; + import testUtilsFile from "@web/../tests/legacy/helpers/test_utils_file"; + import testUtilsMock from "@web/../tests/legacy/helpers/test_utils_mock"; + import Widget from "@web/legacy/js/core/widget"; function deprecated(fn, type) { return function () { @@ -94,40 +94,48 @@ * * @returns {Promise} */ - async function nextTick() { + export async function nextTick() { return testUtilsDom.returnAfterNextAnimationFrame(); } + export const mock = { + addMockEnvironment: testUtilsMock.addMockEnvironment, + addMockEnvironmentOwl: testUtilsMock.addMockEnvironmentOwl, + intercept: testUtilsMock.intercept, + patch: testUtilsMock.patch, + patchDate: testUtilsMock.patchDate, + unpatch: testUtilsMock.unpatch, + getView: testUtilsMock.getView, + }; + + export const dom = { + dragAndDrop: testUtilsDom.dragAndDrop, + find: testUtilsDom.findItem, + click: testUtilsDom.click, + clickFirst: testUtilsDom.clickFirst, + triggerEvents: testUtilsDom.triggerEvents, + triggerEvent: testUtilsDom.triggerEvent, + }; + + export const fields = { + editInput: testUtilsFields.editInput, + editAndTrigger: testUtilsFields.editAndTrigger, + triggerKeydown: testUtilsFields.triggerKeydown, + }; + + export const file = { + createFile: testUtilsFile.createFile, + dragoverFile: testUtilsFile.dragoverFile, + dropFile: testUtilsFile.dropFile, + dropFiles: testUtilsFile.dropFiles, + inputFiles: testUtilsFile.inputFiles, + }; + export default { - mock: { - addMockEnvironment: testUtilsMock.addMockEnvironment, - addMockEnvironmentOwl: testUtilsMock.addMockEnvironmentOwl, - intercept: testUtilsMock.intercept, - patch: testUtilsMock.patch, - patchDate: testUtilsMock.patchDate, - unpatch: testUtilsMock.unpatch, - getView: testUtilsMock.getView, - }, - dom: { - dragAndDrop: testUtilsDom.dragAndDrop, - find: testUtilsDom.findItem, - click: testUtilsDom.click, - clickFirst: testUtilsDom.clickFirst, - triggerEvents: testUtilsDom.triggerEvents, - triggerEvent: testUtilsDom.triggerEvent, - }, - fields: { - editInput: testUtilsFields.editInput, - editAndTrigger: testUtilsFields.editAndTrigger, - triggerKeydown: testUtilsFields.triggerKeydown, - }, - file: { - createFile: testUtilsFile.createFile, - dragoverFile: testUtilsFile.dragoverFile, - dropFile: testUtilsFile.dropFile, - dropFiles: testUtilsFile.dropFiles, - inputFiles: testUtilsFile.inputFiles, - }, + mock, + dom, + fields, + file, createParent, makeTestPromise: makeTestPromise, diff --git a/addons/web/static/tests/legacy/helpers/test_utils_dom.js b/addons/web/static/tests/legacy/helpers/test_utils_dom.js index 49933da02f406..aeaa5bcdc03db 100644 --- a/addons/web/static/tests/legacy/helpers/test_utils_dom.js +++ b/addons/web/static/tests/legacy/helpers/test_utils_dom.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=web.test_utils_dom **/ - - import concurrency from "web.concurrency"; +/** @odoo-module **/ + +import concurrency from "@web/legacy/js/core/concurrency"; /** * DOM Test Utils @@ -128,7 +128,7 @@ * @param {boolean} [options.last=false] if true, clicks on the last element * @returns {Promise} */ - async function click(el, options = {}) { + export async function click(el, options = {}) { let matches, target; let selectorMsg = ""; if (typeof el === 'string') { @@ -324,7 +324,7 @@ * @param {Boolean} [fast=false] true if the trigger event have to wait for a single tick instead of waiting for the next animation frame * @returns {Promise} */ - async function triggerEvent(el, eventType, eventAttrs = {}, fast = false) { + export async function triggerEvent(el, eventType, eventAttrs = {}, fast = false) { let matches; let selectorMsg = ""; if (_isEventTarget(el)) { diff --git a/addons/web/static/tests/legacy/helpers/test_utils_fields.js b/addons/web/static/tests/legacy/helpers/test_utils_fields.js index 568a8e5060f0f..f2069019f3101 100644 --- a/addons/web/static/tests/legacy/helpers/test_utils_fields.js +++ b/addons/web/static/tests/legacy/helpers/test_utils_fields.js @@ -1,5 +1,5 @@ -/** @odoo-module alias=web.test_utils_fields **/ - +/** @odoo-module **/ + /** * Field Test Utils * @@ -9,7 +9,7 @@ * testUtils file. */ - import testUtilsDom from "web.test_utils_dom"; + import testUtilsDom from "@web/../tests/legacy/helpers/test_utils_dom"; const ARROW_KEYS_MAPPING = { down: 'ArrowDown', @@ -34,7 +34,7 @@ * @param {string[]} events * @returns {Promise} */ - async function editAndTrigger(el, value, events) { + export async function editAndTrigger(el, value, events) { if (el instanceof jQuery) { if (el.length !== 1) { throw new Error(`target ${el.selector} has length ${el.length} instead of 1`); @@ -58,7 +58,7 @@ * @param {string|number} value * @returns {Promise} */ - async function editInput(el, value) { + export async function editInput(el, value) { return editAndTrigger(el, value, ['input']); } diff --git a/addons/web/static/tests/legacy/helpers/test_utils_file.js b/addons/web/static/tests/legacy/helpers/test_utils_file.js index 94e19ee55c7b4..7fa1c0fb2e118 100644 --- a/addons/web/static/tests/legacy/helpers/test_utils_file.js +++ b/addons/web/static/tests/legacy/helpers/test_utils_file.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=web.test_utils_file **/ +/** @odoo-module **/ /** * FILE Test Utils @@ -48,7 +48,7 @@ function _createFakeDataTransfer(files) { * @param {string} data.contentType * @returns {Promise} resolved with file created */ -function createFile(data) { +export function createFile(data) { // Note: this is only supported by Chrome, and does not work in Incognito mode return new Promise(function (resolve, reject) { var requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem; @@ -121,7 +121,7 @@ function dropFiles($el, files) { * @param {Object[]} files must have been created beforehand * @see testUtils.file.createFile */ -function inputFiles(el, files) { +export function inputFiles(el, files) { // could not use _createFakeDataTransfer as el.files assignation will only // work with a real FileList object. const dataTransfer = new window.DataTransfer(); diff --git a/addons/web/static/tests/legacy/helpers/test_utils_mock.js b/addons/web/static/tests/legacy/helpers/test_utils_mock.js index 2059ec43286fa..f64bf87a2a74a 100644 --- a/addons/web/static/tests/legacy/helpers/test_utils_mock.js +++ b/addons/web/static/tests/legacy/helpers/test_utils_mock.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=web.test_utils_mock **/ +/** @odoo-module **/ /** * Mock Test Utils @@ -9,16 +9,16 @@ * testUtils file. */ -import AbstractStorageService from "web.AbstractStorageService"; -import AjaxService from "web.AjaxService"; -import basic_fields from "web.basic_fields"; -import Bus from "web.Bus"; -import config from "web.config"; -import core from "web.core"; -import dom from "web.dom"; -import makeTestEnvironment from "web.test_env"; -import MockServer from "web.MockServer"; -import RamStorage from "web.RamStorage"; +import AbstractStorageService from "@web/legacy/js/core/abstract_storage_service"; +import AjaxService from "@web/legacy/js/services/ajax_service"; +import basic_fields from "@web/legacy/js/fields/basic_fields"; +import Bus from "@web/legacy/js/core/bus"; +import config from "@web/legacy/js/services/config"; +import core from "@web/legacy/js/services/core"; +import dom from "@web/legacy/js/core/dom"; +import makeTestEnvironment from "@web/../tests/legacy/helpers/test_env"; +import MockServer from "@web/../tests/legacy/helpers/mock_server"; +import RamStorage from "@web/legacy/js/core/ram_storage"; import session from "web.session"; import { patchWithCleanup, patchDate } from "@web/../tests/helpers/utils"; import { browser } from "@web/core/browser/browser"; diff --git a/addons/web/static/tests/legacy/helpers/test_utils_tests.js b/addons/web/static/tests/legacy/helpers/test_utils_tests.js index f96dbcdf903df..b070333b753a6 100644 --- a/addons/web/static/tests/legacy/helpers/test_utils_tests.js +++ b/addons/web/static/tests/legacy/helpers/test_utils_tests.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import testUtils from "web.test_utils"; +import testUtils from "@web/../tests/legacy/helpers/test_utils"; const { DateTime } = luxon; QUnit.module('web', {}, function () { @@ -31,4 +31,4 @@ QUnit.test('new moment', function (assert) { }); }); -}); \ No newline at end of file +}); diff --git a/addons/web/static/tests/legacy/mock_relational_fields_tests.js b/addons/web/static/tests/legacy/mock_relational_fields_tests.js index ed953b190f32f..24a1d89cb14cc 100644 --- a/addons/web/static/tests/legacy/mock_relational_fields_tests.js +++ b/addons/web/static/tests/legacy/mock_relational_fields_tests.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import MockServer from 'web.MockServer'; +import MockServer from '@web/../tests/legacy/helpers/mock_server'; QUnit.module('web', {}, function () { QUnit.module('legacy', {}, function () { diff --git a/addons/web/static/tests/legacy/mockserver_tests.js b/addons/web/static/tests/legacy/mockserver_tests.js index 3effb82de484d..5aa8a8ab95c9d 100644 --- a/addons/web/static/tests/legacy/mockserver_tests.js +++ b/addons/web/static/tests/legacy/mockserver_tests.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import MockServer from "web.MockServer"; +import MockServer from "@web/../tests/legacy/helpers/mock_server"; QUnit.module("Legacy MockServer", { beforeEach() { diff --git a/addons/web/static/tests/legacy/owl_compatibility_tests.js b/addons/web/static/tests/legacy/owl_compatibility_tests.js index 13949d7049fda..cdbeaf93be473 100644 --- a/addons/web/static/tests/legacy/owl_compatibility_tests.js +++ b/addons/web/static/tests/legacy/owl_compatibility_tests.js @@ -1,17 +1,17 @@ /** @odoo-module **/ - + import { ComponentAdapter, ComponentWrapper, WidgetAdapterMixin, - } from "web.OwlCompatibility"; - import testUtils from "web.test_utils"; - import Widget from "web.Widget"; + } from "@web/legacy/js/owl_compatibility"; + import testUtils from "@web/../tests/legacy/helpers/test_utils"; + import Widget from "@web/legacy/js/core/widget"; import { registry } from "@web/core/registry"; import { LegacyComponent } from "@web/legacy/legacy_component"; import { mapLegacyEnvToWowlEnv, useWowlService } from "@web/legacy/utils"; - import makeTestEnvironment from "web.test_env"; + import makeTestEnvironment from "@web/../tests/legacy/helpers/test_env"; import { makeTestEnv } from "@web/../tests/helpers/mock_env"; import { getFixture, mount, useLogLifeCycle, destroy } from "@web/../tests/helpers/utils"; diff --git a/addons/web/static/tests/legacy/qweb_tests.js b/addons/web/static/tests/legacy/qweb_tests.js index fd255e6556c3a..c27428847298d 100644 --- a/addons/web/static/tests/legacy/qweb_tests.js +++ b/addons/web/static/tests/legacy/qweb_tests.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import {Markup} from "web.utils"; +import { Markup } from "@web/legacy/js/core/utils"; var qwebPath = '/web/static/lib/qweb/'; import {hushConsole} from "@web/../tests/helpers/utils"; diff --git a/addons/web/static/tests/legacy/widgets/name_and_signature_tests.js b/addons/web/static/tests/legacy/widgets/name_and_signature_tests.js index e619ac0282137..8793034064600 100644 --- a/addons/web/static/tests/legacy/widgets/name_and_signature_tests.js +++ b/addons/web/static/tests/legacy/widgets/name_and_signature_tests.js @@ -1,7 +1,7 @@ /** @odoo-module **/ - - import { NameAndSignature } from "web.name_and_signature"; - import testUtils from "web.test_utils"; + + import { NameAndSignature } from "@web/legacy/js/widgets/name_and_signature"; + import testUtils from "@web/../tests/legacy/helpers/test_utils"; const MockedNameAndSignature = NameAndSignature.extend({ events: { ...NameAndSignature.prototype.events, diff --git a/addons/web/static/tests/setup.js b/addons/web/static/tests/setup.js index 43f0bf257ffb1..81236c1f7dcea 100644 --- a/addons/web/static/tests/setup.js +++ b/addons/web/static/tests/setup.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import { _t } from "web.core"; -import LegacyBus from "web.Bus"; +import { _t } from "@web/legacy/js/services/core"; +import LegacyBus from "@web/legacy/js/core/bus"; import session from "web.session"; import { assets, templates } from "@web/core/assets"; import { browser, makeRAMLocalStorage } from "@web/core/browser/browser"; diff --git a/addons/web/static/tests/views/helpers.js b/addons/web/static/tests/views/helpers.js index c82dca7fd850f..66b529af955b8 100644 --- a/addons/web/static/tests/views/helpers.js +++ b/addons/web/static/tests/views/helpers.js @@ -22,7 +22,7 @@ import { addLegacyMockEnvironment } from "../webclient/helpers"; import { Component, useSubEnv, xml } from "@odoo/owl"; import { mapLegacyEnvToWowlEnv } from "@web/legacy/utils"; -import makeTestEnvironment from "web.test_env"; +import makeTestEnvironment from "@web/../tests/legacy/helpers/test_env"; const serviceRegistry = registry.category("services"); diff --git a/addons/web/static/tests/webclient/actions/client_action_tests.js b/addons/web/static/tests/webclient/actions/client_action_tests.js index 1a1e884b84fdf..3f37c1bf4c8ea 100644 --- a/addons/web/static/tests/webclient/actions/client_action_tests.js +++ b/addons/web/static/tests/webclient/actions/client_action_tests.js @@ -2,7 +2,7 @@ import { browser } from "@web/core/browser/browser"; import { registry } from "@web/core/registry"; -import testUtils from "web.test_utils"; +import testUtils from "@web/../tests/legacy/helpers/test_utils"; import { click, getFixture, nextTick, patchWithCleanup } from "../../helpers/utils"; import { createWebClient, doAction, getActionManagerServerData } from "./../helpers"; diff --git a/addons/web/static/tests/webclient/actions/close_action_tests.js b/addons/web/static/tests/webclient/actions/close_action_tests.js index e8bb721ad4ad1..221141610c71a 100644 --- a/addons/web/static/tests/webclient/actions/close_action_tests.js +++ b/addons/web/static/tests/webclient/actions/close_action_tests.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import testUtils from "web.test_utils"; +import testUtils from "@web/../tests/legacy/helpers/test_utils"; import { registerCleanup } from "../../helpers/cleanup"; import { click, diff --git a/addons/web/static/tests/webclient/actions/effects_tests.js b/addons/web/static/tests/webclient/actions/effects_tests.js index 97a180ed12878..ee0cc1348413a 100644 --- a/addons/web/static/tests/webclient/actions/effects_tests.js +++ b/addons/web/static/tests/webclient/actions/effects_tests.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { registry } from "@web/core/registry"; -import testUtils from "web.test_utils"; +import testUtils from "@web/../tests/legacy/helpers/test_utils"; import { clearRegistryWithCleanup } from "../../helpers/mock_env"; import { click, diff --git a/addons/web/static/tests/webclient/actions/misc_tests.js b/addons/web/static/tests/webclient/actions/misc_tests.js index 14badf34f9627..fe111c49040bf 100644 --- a/addons/web/static/tests/webclient/actions/misc_tests.js +++ b/addons/web/static/tests/webclient/actions/misc_tests.js @@ -4,7 +4,7 @@ import { browser } from "@web/core/browser/browser"; import { registry } from "@web/core/registry"; import { session } from "@web/session"; import { makeTestEnv } from "../../helpers/mock_env"; -import testUtils from "web.test_utils"; +import testUtils from "@web/../tests/legacy/helpers/test_utils"; import { click, getFixture, hushConsole, nextTick, patchWithCleanup } from "../../helpers/utils"; import { createWebClient, diff --git a/addons/web/static/tests/webclient/actions/push_state_tests.js b/addons/web/static/tests/webclient/actions/push_state_tests.js index 4a25948156263..4b764d8067c2c 100644 --- a/addons/web/static/tests/webclient/actions/push_state_tests.js +++ b/addons/web/static/tests/webclient/actions/push_state_tests.js @@ -3,7 +3,7 @@ import { browser } from "@web/core/browser/browser"; import { registry } from "@web/core/registry"; import { useService } from "@web/core/utils/hooks"; -import testUtils from "web.test_utils"; +import testUtils from "@web/../tests/legacy/helpers/test_utils"; import { click, getFixture, diff --git a/addons/web/static/tests/webclient/actions/target_tests.js b/addons/web/static/tests/webclient/actions/target_tests.js index b4a5c7bd7ac64..93acdad589131 100644 --- a/addons/web/static/tests/webclient/actions/target_tests.js +++ b/addons/web/static/tests/webclient/actions/target_tests.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import testUtils from "web.test_utils"; +import testUtils from "@web/../tests/legacy/helpers/test_utils"; import { registry } from "@web/core/registry"; import { click, getFixture, patchWithCleanup, makeDeferred, nextTick } from "../../helpers/utils"; import { createWebClient, doAction, getActionManagerServerData } from "./../helpers"; diff --git a/addons/web/static/tests/webclient/actions/window_action_tests.js b/addons/web/static/tests/webclient/actions/window_action_tests.js index 00a2505c30973..041eebe6f8a31 100644 --- a/addons/web/static/tests/webclient/actions/window_action_tests.js +++ b/addons/web/static/tests/webclient/actions/window_action_tests.js @@ -11,7 +11,7 @@ import { editView } from "@web/views/debug_items"; import { listView } from "@web/views/list/list_view"; import { useSetupAction } from "@web/webclient/actions/action_hook"; import { clearUncommittedChanges } from "@web/webclient/actions/action_service"; -import testUtils from "web.test_utils"; +import testUtils from "@web/../tests/legacy/helpers/test_utils"; import { errorService } from "../../../src/core/errors/error_service"; import { registerCleanup } from "../../helpers/cleanup"; import { diff --git a/addons/web/static/tests/webclient/helpers.js b/addons/web/static/tests/webclient/helpers.js index 5c3e3891aa5ca..a3c10a684e2d5 100644 --- a/addons/web/static/tests/webclient/helpers.js +++ b/addons/web/static/tests/webclient/helpers.js @@ -18,10 +18,10 @@ import { effectService } from "@web/core/effects/effect_service"; import { hotkeyService } from "@web/core/hotkeys/hotkey_service"; import { menuService } from "@web/webclient/menus/menu_service"; import { WebClient } from "@web/webclient/webclient"; -import AbstractService from "web.AbstractService"; -import basicFields from "web.basic_fields"; -import core from "web.core"; -import makeTestEnvironment from "web.test_env"; +import AbstractService from "@web/legacy/js/core/abstract_service"; +import basicFields from "@web/legacy/js/fields/basic_fields"; +import core from "@web/legacy/js/services/core"; +import makeTestEnvironment from "@web/../tests/legacy/helpers/test_env"; import { registerCleanup } from "../helpers/cleanup"; import { makeTestEnv } from "../helpers/mock_env"; import { @@ -40,13 +40,13 @@ import { patchWithCleanup, } from "../helpers/utils"; import session from "web.session"; -import LegacyMockServer from "web.MockServer"; -import Widget from "web.Widget"; +import LegacyMockServer from "@web/../tests/legacy/helpers/mock_server"; +import Widget from "@web/legacy/js/core/widget"; import { uiService } from "@web/core/ui/ui_service"; import { commandService } from "@web/core/commands/command_service"; import { ConnectionAbortedError } from "@web/core/network/rpc_service"; import { CustomFavoriteItem } from "@web/search/custom_favorite_item/custom_favorite_item"; -import { standaloneAdapter } from "web.OwlCompatibility"; +import { standaloneAdapter } from "@web/legacy/js/owl_compatibility"; import { overlayService } from "@web/core/overlay/overlay_service"; import { Component, xml } from "@odoo/owl"; diff --git a/addons/web/tests/test_click_everywhere.py b/addons/web/tests/test_click_everywhere.py index 8a562307dc6ae..1b2b6aee6516e 100644 --- a/addons/web/tests/test_click_everywhere.py +++ b/addons/web/tests/test_click_everywhere.py @@ -14,7 +14,7 @@ def test_01_click_everywhere_as_admin(self): for app_id in menus['root']['children']: with self.subTest(app=menus[app_id]['name']): _logger.runbot('Testing %s', menus[app_id]['name']) - self.browser_js("/web", "odoo.__DEBUG__.services['web.clickEverywhere']('%s');" % menus[app_id]['xmlid'], "odoo.isReady === true", login="admin", timeout=600) + self.browser_js("/web", "odoo.__DEBUG__.services['@web/webclient/clickbot/clickbot_loader'].startClickEverywhere('%s');" % menus[app_id]['xmlid'], "odoo.isReady === true", login="admin", timeout=600) @odoo.tests.tagged('click_all', 'post_install', '-at_install', '-standard') @@ -26,16 +26,16 @@ def test_01_click_everywhere_as_demo(self): for app_id in menus['root']['children']: with self.subTest(app=menus[app_id]['name']): _logger.runbot('Testing %s', menus[app_id]['name']) - self.browser_js("/web", "odoo.__DEBUG__.services['web.clickEverywhere']('%s');" % menus[app_id]['xmlid'], "odoo.isReady === true", login="demo", timeout=600) + self.browser_js("/web", "odoo.__DEBUG__.services['@web/webclient/clickbot/clickbot_loader'].startClickEverywhere('%s');" % menus[app_id]['xmlid'], "odoo.isReady === true", login="demo", timeout=600) @odoo.tests.tagged('post_install', '-at_install') class TestMenusAdminLight(odoo.tests.HttpCase): allow_end_on_form = True def test_01_click_apps_menus_as_admin(self): - self.browser_js("/web", "odoo.__DEBUG__.services['web.clickEverywhere'](undefined, true);", "odoo.isReady === true", login="admin", timeout=120) + self.browser_js("/web", "odoo.__DEBUG__.services['@web/webclient/clickbot/clickbot_loader'].startClickEverywhere(undefined, true);", "odoo.isReady === true", login="admin", timeout=120) @odoo.tests.tagged('post_install', '-at_install',) class TestMenusDemoLight(odoo.tests.HttpCase): allow_end_on_form = True def test_01_click_apps_menus_as_demo(self): - self.browser_js("/web", "odoo.__DEBUG__.services['web.clickEverywhere'](undefined, true);", "odoo.isReady === true", login="demo", timeout=120) + self.browser_js("/web", "odoo.__DEBUG__.services['@web/webclient/clickbot/clickbot_loader'].startClickEverywhere(undefined, true);", "odoo.isReady === true", login="demo", timeout=120) diff --git a/addons/web_editor/static/src/components/media_dialog/icon_selector.js b/addons/web_editor/static/src/components/media_dialog/icon_selector.js index d56d0338ffd2a..ef6f5b17b49b1 100644 --- a/addons/web_editor/static/src/components/media_dialog/icon_selector.js +++ b/addons/web_editor/static/src/components/media_dialog/icon_selector.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import fonts from 'wysiwyg.fonts'; +import fonts from '@web_editor/js/wysiwyg/fonts'; import { SearchMedia } from './search_media'; import { Component, useState } from "@odoo/owl"; diff --git a/addons/web_editor/static/src/components/media_dialog/image_selector.js b/addons/web_editor/static/src/components/media_dialog/image_selector.js index ae605501cbbc7..bbe9669b31297 100644 --- a/addons/web_editor/static/src/components/media_dialog/image_selector.js +++ b/addons/web_editor/static/src/components/media_dialog/image_selector.js @@ -1,7 +1,7 @@ /** @odoo-module */ import { useService } from '@web/core/utils/hooks'; -import { getCSSVariableValue, DEFAULT_PALETTE } from 'web_editor.utils'; +import weUtils from '@web_editor/js/common/utils'; import { Attachment, FileSelector, IMAGE_MIMETYPES, IMAGE_EXTENSIONS } from './file_selector'; import { KeepLast } from "@web/core/utils/concurrency"; @@ -155,7 +155,7 @@ export class ImageSelector extends FileSelector { // Color-substitution for dynamic SVG attachment const primaryColors = {}; for (let color = 1; color <= 5; color++) { - primaryColors[color] = getCSSVariableValue('o-color-' + color); + primaryColors[color] = weUtils.getCSSVariableValue('o-color-' + color); } return attachments.map(attachment => { if (attachment.image_src.startsWith('/')) { @@ -278,7 +278,7 @@ export class ImageSelector extends FileSelector { colorCustomizedURL.searchParams.forEach((value, key) => { const match = key.match(/^c([1-5])$/); if (match) { - colorCustomizedURL.searchParams.set(key, getCSSVariableValue(`o-color-${match[1]}`)); + colorCustomizedURL.searchParams.set(key, weUtils.getCSSVariableValue(`o-color-${match[1]}`)); } }); attachment.image_src = colorCustomizedURL.pathname + colorCustomizedURL.search; @@ -332,11 +332,11 @@ export class ImageSelector extends FileSelector { if (response.headers.get('content-type') === 'image/svg+xml') { let svg = await response.text(); const dynamicColors = {}; - const combinedColorsRegex = new RegExp(Object.values(DEFAULT_PALETTE).join('|'), 'gi'); + const combinedColorsRegex = new RegExp(Object.values(weUtils.DEFAULT_PALETTE).join('|'), 'gi'); svg = svg.replace(combinedColorsRegex, match => { - const colorId = Object.keys(DEFAULT_PALETTE).find(key => DEFAULT_PALETTE[key] === match.toUpperCase()); + const colorId = Object.keys(weUtils.DEFAULT_PALETTE).find(key => weUtils.DEFAULT_PALETTE[key] === match.toUpperCase()); const colorKey = 'c' + colorId - dynamicColors[colorKey] = getCSSVariableValue('o-color-' + colorId); + dynamicColors[colorKey] = weUtils.getCSSVariableValue('o-color-' + colorId); return dynamicColors[colorKey]; }); const fileName = mediaUrl.split('/').pop(); diff --git a/addons/web_editor/static/src/components/upload_progress_toast/upload_service.js b/addons/web_editor/static/src/components/upload_progress_toast/upload_service.js index 6ccddf2610509..1ccaa373128a0 100644 --- a/addons/web_editor/static/src/components/upload_progress_toast/upload_service.js +++ b/addons/web_editor/static/src/components/upload_progress_toast/upload_service.js @@ -2,7 +2,7 @@ import { registry } from '@web/core/registry'; import { UploadProgressToast } from './upload_progress_toast'; -import { getDataURLFromFile } from 'web.utils'; +import utils from '@web/legacy/js/core/utils'; import { reactive } from "@odoo/owl"; @@ -98,7 +98,7 @@ export const uploadService = { // limited by bandwidth. for (const sortedFile of sortedFiles) { const file = progressToast.files[sortedFile.progressToastId]; - const dataURL = await getDataURLFromFile(sortedFile); + const dataURL = await utils.getDataURLFromFile(sortedFile); try { const xhr = new XMLHttpRequest(); xhr.upload.addEventListener('progress', ev => { diff --git a/addons/web_editor/static/src/js/backend/convert_inline.js b/addons/web_editor/static/src/js/backend/convert_inline.js index 1fe6797afc14f..f1d08c487307b 100644 --- a/addons/web_editor/static/src/js/backend/convert_inline.js +++ b/addons/web_editor/static/src/js/backend/convert_inline.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=web_editor.convertInline */ +/** @odoo-module */ 'use strict'; import { getAdjacentPreviousSiblings, isBlock, rgbToHex, commonParentGet } from '../editor/odoo-editor/src/utils/utils'; @@ -662,7 +662,7 @@ function enforceImagesResponsivity(editable) { * specificity: number;}> * @param {JQuery} [$iframe] the iframe containing the editable, if any */ -async function toInline($editable, cssRules, $iframe) { +export async function toInline($editable, cssRules, $iframe) { $editable.removeClass('odoo-editor-editable'); const editable = $editable.get(0); const iframe = $iframe && $iframe.get(0); @@ -802,7 +802,7 @@ function flattenBackgroundImages(editable) { */ function fontToImg($editable) { const editable = $editable.get(0); - const fonts = odoo.__DEBUG__.services["wysiwyg.fonts"]; + const { fonts } = odoo.__DEBUG__.services["@web_editor/js/wysiwyg/fonts"]; for (const font of editable.querySelectorAll('.fa')) { let icon, content; @@ -1025,7 +1025,7 @@ function formatTables($editable) { * style: {[styleName]: string}; * specificity: number;}> */ -function getCSSRules(doc) { +export function getCSSRules(doc) { const cssRules = []; for (const sheet of doc.styleSheets) { // try...catch because browser may not able to enumerate rules for cross-domain sheets diff --git a/addons/web_editor/static/src/js/backend/html_field.js b/addons/web_editor/static/src/js/backend/html_field.js index 7c4ada205b94d..32ca2a467c267 100644 --- a/addons/web_editor/static/src/js/backend/html_field.js +++ b/addons/web_editor/static/src/js/backend/html_field.js @@ -16,7 +16,7 @@ import { getAdjacentNextSiblings, getRangePosition } from '@web_editor/js/editor/odoo-editor/src/utils/utils'; -import { toInline } from 'web_editor.convertInline'; +import { toInline } from '@web_editor/js/backend/convert_inline'; import { loadJS, getBundle } from '@web/core/assets'; import { Component, diff --git a/addons/web_editor/static/src/js/common/ace.js b/addons/web_editor/static/src/js/common/ace.js index c092af7172410..8e52523c4118e 100644 --- a/addons/web_editor/static/src/js/common/ace.js +++ b/addons/web_editor/static/src/js/common/ace.js @@ -1,12 +1,12 @@ -/** @odoo-module alias=web_editor.ace **/ - -import config from "web.config"; -import concurrency from "web.concurrency"; -import core from "web.core"; -import dom from "web.dom"; -import Dialog from "web.Dialog"; -import Widget from "web.Widget"; -import localStorage from "web.local_storage"; +/** @odoo-module **/ + +import config from "@web/legacy/js/services/config"; +import concurrency from "@web/legacy/js/core/concurrency"; +import core from "@web/legacy/js/services/core"; +import dom from "@web/legacy/js/core/dom"; +import Dialog from "@web/legacy/js/core/dialog"; +import Widget from "@web/legacy/js/core/widget"; +import localStorage from "@web/legacy/js/core/local_storage"; import { sprintf } from "@web/core/utils/strings"; import { debounce } from "@web/core/utils/timing"; import { sortBy } from "@web/core/utils/arrays"; diff --git a/addons/web_editor/static/src/js/common/grid_layout_utils.js b/addons/web_editor/static/src/js/common/grid_layout_utils.js index 0f9b3b10a2d8f..4c8fb8284536c 100644 --- a/addons/web_editor/static/src/js/common/grid_layout_utils.js +++ b/addons/web_editor/static/src/js/common/grid_layout_utils.js @@ -1,7 +1,7 @@ /** @odoo-module **/ 'use strict'; -import {qweb} from 'web.core'; +import {qweb} from "@web/legacy/js/services/core"; import {descendants, preserveCursor} from "@web_editor/js/editor/odoo-editor/src/utils/utils"; const rowSize = 50; // 50px. // Maximum number of rows that can be added when dragging a grid item. diff --git a/addons/web_editor/static/src/js/common/utils.js b/addons/web_editor/static/src/js/common/utils.js index a5198ce08d1f5..53707e352acce 100644 --- a/addons/web_editor/static/src/js/common/utils.js +++ b/addons/web_editor/static/src/js/common/utils.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=web_editor.utils **/ +/** @odoo-module **/ import { normalizeCSSColor, diff --git a/addons/web_editor/static/src/js/editor/custom_colors.js b/addons/web_editor/static/src/js/editor/custom_colors.js index 6b9081ecafb1d..a2e860ba2c931 100644 --- a/addons/web_editor/static/src/js/editor/custom_colors.js +++ b/addons/web_editor/static/src/js/editor/custom_colors.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -// These colors are already normalized as per normalizeCSSColor in web.Colorpicker +// These colors are already normalized as per normalizeCSSColor in @web/legacy/js/widgets/colorpicker export default [ ['#000000', '#424242', '#636363', '#9C9C94', '#CEC6CE', '#EFEFEF', '#F7F7F7', '#FFFFFF'], ['#FF0000', '#FF9C00', '#FFFF00', '#00FF00', '#00FFFF', '#0000FF', '#9C00FF', '#FF00FF'], diff --git a/addons/web_editor/static/src/js/editor/image_processing.js b/addons/web_editor/static/src/js/editor/image_processing.js index 8b66f16e6f610..ab7f33a86aef3 100644 --- a/addons/web_editor/static/src/js/editor/image_processing.js +++ b/addons/web_editor/static/src/js/editor/image_processing.js @@ -1,11 +1,11 @@ -/** @odoo-module alias=web_editor.image_processing **/ +/** @odoo-module **/ import { pick } from "@web/core/utils/objects"; import {getAffineApproximation, getProjective} from "@web_editor/js/editor/perspective_utils"; // Fields returned by cropperjs 'getData' method, also need to be passed when // initializing the cropper to reuse the previous crop. -const cropperDataFields = ['x', 'y', 'width', 'height', 'rotate', 'scaleX', 'scaleY']; +export const cropperDataFields = ['x', 'y', 'width', 'height', 'rotate', 'scaleX', 'scaleY']; const modifierFields = [ 'filter', 'quality', @@ -16,7 +16,7 @@ const modifierFields = [ 'resizeWidth', 'aspectRatio', ]; -const isGif = (mimetype) => mimetype === 'image/gif'; +export const isGif = (mimetype) => mimetype === 'image/gif'; // webgl color filters const _applyAll = (result, filter, filters) => { @@ -200,7 +200,7 @@ const glFilters = { * @param {HTMLImageElement} img the image to which modifications are applied * @returns {string} dataURL of the image with the applied modifications */ -async function applyModifications(img, dataOptions = {}) { +export async function applyModifications(img, dataOptions = {}) { const data = Object.assign({ glFilter: '', filter: '#0000', @@ -350,7 +350,7 @@ async function applyModifications(img, dataOptions = {}) { * @param {HTMLImageElement} [img] img element in which to load the image * @returns {Promise} Promise that resolves to the loaded img */ -function loadImage(src, img = new Image()) { +export function loadImage(src, img = new Image()) { return new Promise((resolve, reject) => { img.addEventListener('load', () => resolve(img), {once: true}); img.addEventListener('error', reject, {once: true}); @@ -416,7 +416,7 @@ function _getImageSizeFromCache(src) { * @param {Number} aspectRatio the aspectRatio of the crop box * @param {DOMStringMap} dataset dataset containing the cropperDataFields */ -async function activateCropper(image, aspectRatio, dataset) { +export async function activateCropper(image, aspectRatio, dataset) { image.src = await _loadImageObjectURL(image.getAttribute('src')); $(image).cropper({ viewMode: 2, @@ -440,7 +440,7 @@ async function activateCropper(image, aspectRatio, dataset) { * @param {string} [attachmentSrc=''] specifies the URL of the corresponding * attachment if it can't be found in the 'src' attribute. */ -async function loadImageInfo(img, rpc, attachmentSrc = '') { +export async function loadImageInfo(img, rpc, attachmentSrc = '') { const src = attachmentSrc || img.getAttribute('src'); // If there is a marked originalSrc, the data is already loaded. if (img.dataset.originalSrc || !src) { @@ -452,7 +452,7 @@ async function loadImageInfo(img, rpc, attachmentSrc = '') { params: {src: src.split(/[?#]/)[0]}, }); // Check that url is local. - const isLocal = original && new URL(original.image_src, window.location.origin).origin === window.location.origin + const isLocal = original && new URL(original.image_src, window.location.origin).origin === window.location.origin && !/\/web\/image\/\d+-redirect\//.test(original.image_src); if (isLocal && original.image_src) { img.dataset.originalId = original.id; @@ -467,7 +467,7 @@ async function loadImageInfo(img, rpc, attachmentSrc = '') { * won't be accepted. * @returns {Boolean} */ -function isImageSupportedForProcessing(mimetype, strict = false) { +export function isImageSupportedForProcessing(mimetype, strict = false) { if (isGif(mimetype)) { return !strict; } @@ -477,7 +477,7 @@ function isImageSupportedForProcessing(mimetype, strict = false) { * @param {HTMLImageElement} img * @returns {Boolean} */ -function isImageSupportedForStyle(img) { +export function isImageSupportedForStyle(img) { if (!img.parentElement) { return false; } @@ -501,7 +501,7 @@ function isImageSupportedForStyle(img) { * @param {Blob} blob * @returns {Promise} */ -function createDataURL(blob) { +export function createDataURL(blob) { return new Promise((resolve, reject) => { const reader = new FileReader(); reader.addEventListener('load', () => resolve(reader.result)); @@ -515,18 +515,20 @@ function createDataURL(blob) { * @param {String} dataURL * @returns {Number} number of bytes represented with base64 */ -function getDataURLBinarySize(dataURL) { +export function getDataURLBinarySize(dataURL) { // Every 4 bytes of base64 represent 3 bytes. return dataURL.split(',')[1].length / 4 * 3; } +export const removeOnImageChangeAttrs = [...cropperDataFields, ...modifierFields, 'aspectRatio']; + export default { applyModifications, cropperDataFields, activateCropper, loadImageInfo, loadImage, - removeOnImageChangeAttrs: [...cropperDataFields, ...modifierFields, 'aspectRatio'], + removeOnImageChangeAttrs, isImageSupportedForProcessing, isImageSupportedForStyle, createDataURL, diff --git a/addons/web_editor/static/src/js/editor/snippets.editor.js b/addons/web_editor/static/src/js/editor/snippets.editor.js index feb3800cf7272..280222c7ed485 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -1,15 +1,15 @@ -/** @odoo-module alias=web_editor.snippet.editor **/ - -import concurrency from "web.concurrency"; -import core from "web.core"; -import Dialog from "web.Dialog"; -import dom from "web.dom"; -import {Markup, confine} from "web.utils"; -import Widget from "web.Widget"; -import options from "web_editor.snippets.options"; -import { ColorPalette } from '@web_editor/js/wysiwyg/widgets/color_palette'; -import SmoothScrollOnDrag from "web.smooth_scroll_on_drag"; -import {getCSSVariableValue} from "web_editor.utils"; +/** @odoo-module **/ + +import concurrency from "@web/legacy/js/core/concurrency"; +import core from "@web/legacy/js/services/core"; +import Dialog from "@web/legacy/js/core/dialog"; +import dom from "@web/legacy/js/core/dom"; +import { Markup, confine } from "@web/legacy/js/core/utils"; +import Widget from "@web/legacy/js/core/widget"; +import options from "@web_editor/js/editor/snippets.options"; +import { ColorPalette } from "@web_editor/js/wysiwyg/widgets/color_palette"; +import SmoothScrollOnDrag from "@web/legacy/js/core/smooth_scroll_on_drag"; +import weUtils from "@web_editor/js/common/utils"; import * as gridUtils from "@web_editor/js/common/grid_layout_utils"; import { sprintf, escape } from "@web/core/utils/strings"; const QWeb = core.qweb; @@ -18,7 +18,7 @@ import { debounce, throttleForAnimation } from "@web/core/utils/timing"; import { uniqueId } from "@web/core/utils/functions"; import { sortBy, unique } from "@web/core/utils/arrays"; import { browser } from "@web/core/browser/browser"; -import { ComponentWrapper } from "web.OwlCompatibility"; +import { ComponentWrapper } from "@web/legacy/js/owl_compatibility"; import { Toolbar } from "@web_editor/js/editor/toolbar"; import { Component, @@ -3271,7 +3271,7 @@ var SnippetsMenu = Widget.extend({ colorCustomizedURL.searchParams.forEach((value, key) => { const match = key.match(/^c([1-5])$/); if (match) { - colorCustomizedURL.searchParams.set(key, getCSSVariableValue(`o-color-${match[1]}`)); + colorCustomizedURL.searchParams.set(key, weUtils.getCSSVariableValue(`o-color-${match[1]}`)); } }); dynamicSvg.src = colorCustomizedURL.pathname + colorCustomizedURL.search; diff --git a/addons/web_editor/static/src/js/editor/snippets.options.js b/addons/web_editor/static/src/js/editor/snippets.options.js index d7049e8333107..54df499c5b0bd 100644 --- a/addons/web_editor/static/src/js/editor/snippets.options.js +++ b/addons/web_editor/static/src/js/editor/snippets.options.js @@ -1,17 +1,17 @@ -/** @odoo-module alias=web_editor.snippets.options **/ +/** @odoo-module **/ -import { ComponentWrapper } from "web.OwlCompatibility"; +import { ComponentWrapper } from "@web/legacy/js/owl_compatibility"; import { MediaDialogWrapper } from "@web_editor/components/media_dialog/media_dialog_wrapper"; -import core from "web.core"; -import Dialog from "web.Dialog"; -import {scrollTo} from "web.dom"; -import rpc from "web.rpc"; -import time from "web.time"; +import core from "@web/legacy/js/services/core"; +import Dialog from "@web/legacy/js/core/dialog"; +import dom from "@web/legacy/js/core/dom"; +import rpc from "@web/legacy/js/core/rpc"; +import time from "@web/legacy/js/core/time"; import { throttleForAnimation, debounce } from "@web/core/utils/timing"; -import utils from "web.utils"; -import Widget from "web.Widget"; -import { ColorPalette } from '@web_editor/js/wysiwyg/widgets/color_palette'; -import weUtils from "web_editor.utils"; +import utils from "@web/legacy/js/core/utils"; +import Widget from "@web/legacy/js/core/widget"; +import { ColorPalette } from "@web_editor/js/wysiwyg/widgets/color_palette"; +import weUtils from "@web_editor/js/common/utils"; import * as gridUtils from "@web_editor/js/common/grid_layout_utils"; const { normalizeColor, @@ -32,7 +32,7 @@ import { createDataURL, isGif, getDataURLBinarySize, -} from "web_editor.image_processing"; +} from "@web_editor/js/editor/image_processing"; import * as OdooEditorLib from "@web_editor/js/editor/odoo-editor/src/OdooEditor"; import {SIZES, MEDIAS_BREAKPOINTS} from "@web/core/ui/ui_service"; import { sprintf } from "@web/core/utils/strings"; @@ -5460,7 +5460,7 @@ registry.SnippetMove = SnippetOptionWidget.extend({ const bottomHidden = heightDiff < elTop; const hidden = elTop < 0 || bottomHidden; if (hidden) { - scrollTo(this.$target[0], { + dom.scrollTo(this.$target[0], { extraOffset: 50, forcedOffset: bottomHidden ? heightDiff - 50 : undefined, easing: 'linear', @@ -7545,7 +7545,7 @@ registry.BackgroundPosition = SnippetOptionWidget.extend({ ? Math.min(viewportBottom, rect.bottom) - rect.top // Starts inside : 0; // Starts after if (visibleHeight < 200) { - await scrollTo(this.$target[0], {extraOffset: 50}); + await dom.scrollTo(this.$target[0], {extraOffset: 50}); } this._toggleBgOverlay(true); }, diff --git a/addons/web_editor/static/src/js/frontend/loadWysiwygFromTextarea.js b/addons/web_editor/static/src/js/frontend/loadWysiwygFromTextarea.js index 22ae11664f079..9c270a3a44117 100644 --- a/addons/web_editor/static/src/js/frontend/loadWysiwygFromTextarea.js +++ b/addons/web_editor/static/src/js/frontend/loadWysiwygFromTextarea.js @@ -16,7 +16,7 @@ export async function loadWysiwygFromTextarea(parent, textarea, options) { currentOptions.value = '


'; } - const { ComponentWrapper } = await requireLegacyModule('web.OwlCompatibility') + const { ComponentWrapper } = await requireLegacyModule('@web/legacy/js/owl_compatibility') const { Wysiwyg } = await requireLegacyModule('@web_editor/js/wysiwyg/wysiwyg', async () => { const bundle = await getBundle('web_editor.assets_wysiwyg'); await loadBundle(bundle); diff --git a/addons/web_editor/static/src/js/frontend/loader.js b/addons/web_editor/static/src/js/frontend/loader.js index 97d0a45062769..b6470976c706d 100644 --- a/addons/web_editor/static/src/js/frontend/loader.js +++ b/addons/web_editor/static/src/js/frontend/loader.js @@ -15,7 +15,8 @@ export async function requireLegacyModule(moduleName, loadCallback = () => {}) { await loadCallback(); await odoo.ready(moduleName); } - return odoo.__DEBUG__.services[moduleName]; + const mod = odoo.__DEBUG__.services[moduleName] + return mod[Symbol.for('default')] || mod; } export async function requireWysiwygLegacyModule(moduleName) { diff --git a/addons/web_editor/static/src/js/wysiwyg/fonts.js b/addons/web_editor/static/src/js/wysiwyg/fonts.js index 113867ef8cc7d..6742406dc6cde 100644 --- a/addons/web_editor/static/src/js/wysiwyg/fonts.js +++ b/addons/web_editor/static/src/js/wysiwyg/fonts.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=wysiwyg.fonts **/ +/** @odoo-module **/ -export default { +export const fonts = { /** * Retrieves all the CSS rules which match the given parser (Regex). * @@ -98,3 +98,5 @@ export default { } }, }; + +export default fonts; diff --git a/addons/web_editor/static/src/js/wysiwyg/widgets/alt_dialog.js b/addons/web_editor/static/src/js/wysiwyg/widgets/alt_dialog.js index e428ea45a780e..660578f5ce5b8 100644 --- a/addons/web_editor/static/src/js/wysiwyg/widgets/alt_dialog.js +++ b/addons/web_editor/static/src/js/wysiwyg/widgets/alt_dialog.js @@ -1,6 +1,5 @@ /** @odoo-module **/ - import { Component, useRef } from "@odoo/owl"; import { Dialog } from "@web/core/dialog/dialog"; diff --git a/addons/web_editor/static/src/js/wysiwyg/widgets/color_palette.js b/addons/web_editor/static/src/js/wysiwyg/widgets/color_palette.js index 4e0ef6ef8954a..3dc20c3ce32a5 100644 --- a/addons/web_editor/static/src/js/wysiwyg/widgets/color_palette.js +++ b/addons/web_editor/static/src/js/wysiwyg/widgets/color_palette.js @@ -3,7 +3,7 @@ import session from "web.session"; import { Colorpicker } from "@web/core/colorpicker/colorpicker"; import customColors from "@web_editor/js/editor/custom_colors"; -import weUtils from "web_editor.utils"; +import weUtils from "@web_editor/js/common/utils"; import { isCSSColor, normalizeCSSColor, diff --git a/addons/web_editor/static/src/js/wysiwyg/widgets/image_crop.js b/addons/web_editor/static/src/js/wysiwyg/widgets/image_crop.js index c79d8ea52d2e5..bb84c830d3ea5 100644 --- a/addons/web_editor/static/src/js/wysiwyg/widgets/image_crop.js +++ b/addons/web_editor/static/src/js/wysiwyg/widgets/image_crop.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import {applyModifications, cropperDataFields, activateCropper, loadImage, loadImageInfo} from "web_editor.image_processing"; +import {applyModifications, cropperDataFields, activateCropper, loadImage, loadImageInfo} from "@web_editor/js/editor/image_processing"; import { _t } from "@web/core/l10n/translation"; import { Component, @@ -10,7 +10,7 @@ import { onWillDestroy, onWillUpdateProps, } from "@odoo/owl"; -import { Markup } from "web.utils"; +import { Markup } from '@web/legacy/js/core/utils'; export class ImageCrop extends Component { static template = 'web_editor.ImageCrop'; diff --git a/addons/web_editor/static/src/js/wysiwyg/widgets/link.js b/addons/web_editor/static/src/js/wysiwyg/widgets/link.js index 8c43fdb2a9626..76a8438d95236 100644 --- a/addons/web_editor/static/src/js/wysiwyg/widgets/link.js +++ b/addons/web_editor/static/src/js/wysiwyg/widgets/link.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=wysiwyg.widgets.Link **/ +/** @odoo-module **/ import * as OdooEditorLib from "@web_editor/js/editor/odoo-editor/src/OdooEditor"; -import {isColorGradient} from "web_editor.utils"; +import weUtils from "@web_editor/js/common/utils"; import { Component, onWillStart, @@ -137,8 +137,8 @@ export class Link extends Component { data.classes.includes(className) )) { this.$link.css('color', data.classes.includes(data.customTextColor) ? '' : data.customTextColor); - this.$link.css('background-color', data.classes.includes(data.customFill) || isColorGradient(data.customFill) ? '' : data.customFill); - this.$link.css('background-image', isColorGradient(data.customFill) ? data.customFill : ''); + this.$link.css('background-color', data.classes.includes(data.customFill) || weUtils.isColorGradient(data.customFill) ? '' : data.customFill); + this.$link.css('background-image', weUtils.isColorGradient(data.customFill) ? data.customFill : ''); this.$link.css('border-width', data.customBorderWidth); this.$link.css('border-style', data.customBorderStyle); this.$link.css('border-color', data.customBorder); diff --git a/addons/web_editor/static/src/js/wysiwyg/widgets/link_tools.js b/addons/web_editor/static/src/js/wysiwyg/widgets/link_tools.js index e0f83ded6051f..34070cc3b9eb3 100644 --- a/addons/web_editor/static/src/js/wysiwyg/widgets/link_tools.js +++ b/addons/web_editor/static/src/js/wysiwyg/widgets/link_tools.js @@ -2,13 +2,7 @@ import { Link } from "./link"; import { ColorPalette } from '@web_editor/js/wysiwyg/widgets/color_palette'; -import { - computeColorClasses, - getCSSVariableValue, - getColorClass, - getNumericAndUnit, - isColorGradient, -} from "web_editor.utils"; +import weUtils from "@web_editor/js/common/utils"; import { onWillUpdateProps, useState, @@ -226,7 +220,7 @@ export class LinkTools extends Link { if ( !textClass || !colorPickerFg || - !computeColorClasses(colorPickerFg, 'text-').includes(textClass) + !weUtils.computeColorClasses(colorPickerFg, 'text-').includes(textClass) ) { textClass = ''; } @@ -235,7 +229,7 @@ export class LinkTools extends Link { if ( !fillClass || !colorPickerBg || - !computeColorClasses(colorPickerBg, 'bg-').includes(fillClass) + !weUtils.computeColorClasses(colorPickerBg, 'bg-').includes(fillClass) ) { fillClass = ''; } @@ -284,7 +278,7 @@ export class LinkTools extends Link { this._updateColorpicker('border-color'); const borderWidth = this.linkEl.style['border-width']; - const numberAndUnit = getNumericAndUnit(borderWidth); + const numberAndUnit = weUtils.getNumericAndUnit(borderWidth); this.$el.find('.link-custom-color-border input').val(numberAndUnit ? numberAndUnit[0] : "1"); let borderStyle = this.linkEl.style['border-style']; if (!borderStyle || borderStyle === 'none') { @@ -310,14 +304,14 @@ export class LinkTools extends Link { // Update selected color. const colorNames = this.colorpickers[cssProperty].colorNames; let color = this.linkEl.style[cssProperty]; - const colorClasses = prefix ? computeColorClasses(colorNames, prefix) : []; - const colorClass = prefix && getColorClass(this.linkEl, colorNames, prefix); + const colorClasses = prefix ? weUtils.computeColorClasses(colorNames, prefix) : []; + const colorClass = prefix && weUtils.getColorClass(this.linkEl, colorNames, prefix); const isColorClass = colorClasses.includes(colorClass); if (isColorClass) { color = colorClass; } else if (cssProperty === 'background-color') { const gradientColor = this.linkEl.style['background-image']; - if (isColorGradient(gradientColor)) { + if (weUtils.isColorGradient(gradientColor)) { color = gradientColor; } } @@ -332,14 +326,14 @@ export class LinkTools extends Link { // Update preview. const $colorPreview = this.$el.find('.link-custom-color-' + (cssProperty === 'border-color' ? 'border' : cssProperty === 'color' ? 'text' : 'fill') + ' .o_we_color_preview'); - const previewClasses = computeColorClasses(colorNames, 'bg-'); + const previewClasses = weUtils.computeColorClasses(colorNames, 'bg-'); $colorPreview[0].classList.remove(...previewClasses); if (isColorClass) { $colorPreview.css('background-color', `var(--we-cp-${color.replace(prefix, '')}`); $colorPreview.css('background-image', ''); } else { - $colorPreview.css('background-color', isColorGradient(color) ? 'rgba(0, 0, 0, 0)' : color); - $colorPreview.css('background-image', isColorGradient(color) ? color : ''); + $colorPreview.css('background-color', weUtils.isColorGradient(color) ? 'rgba(0, 0, 0, 0)' : color); + $colorPreview.css('background-image', weUtils.isColorGradient(color) ? color : ''); } } @@ -375,13 +369,13 @@ export class LinkTools extends Link { const prefix = this.PREFIXES[cssProperty]; let color = params.color; const colorNames = this.colorpickers[cssProperty].colorNames; - const colorClasses = prefix ? computeColorClasses(colorNames, prefix) : []; + const colorClasses = prefix ? weUtils.computeColorClasses(colorNames, prefix) : []; const colorClass = `${prefix}${color}`; if (colorClasses.includes(colorClass)) { color = colorClass; } else if (colorNames.includes(color)) { // Store as color value. - color = getCSSVariableValue(color); + color = weUtils.getCSSVariableValue(color); } this.customColors[cssProperty] = color; this.applyLinkToDom(this._getData()); diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js index 0a28de84d1dcf..5447e4571d25a 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js @@ -14,7 +14,7 @@ import { AltDialog } from '@web_editor/js/wysiwyg/widgets/alt_dialog'; import { ImageCrop } from '@web_editor/js/wysiwyg/widgets/image_crop'; import * as wysiwygUtils from "@web_editor/js/common/wysiwyg_utils"; -import weUtils from "web_editor.utils"; +import weUtils from "@web_editor/js/common/utils"; import { isSelectionInSelectors } from '@web_editor/js/editor/odoo-editor/src/utils/utils'; import { PeerToPeer } from "@web_editor/js/wysiwyg/PeerToPeer"; import { uniqueId } from "@web/core/utils/functions"; @@ -1234,7 +1234,7 @@ export class Wysiwyg extends Component { $odooFields.each((i, field) => { const observer = new MutationObserver((mutations) => { mutations = this.odooEditor.filterMutationRecords(mutations); - mutations = mutations.filter(rec => + mutations = mutations.filter(rec => !(rec.type === "attributes" && (rec.attributeName.startsWith("data-oe-t"))) ); if (!mutations.length) { @@ -1713,7 +1713,7 @@ export class Wysiwyg extends Component { */ async _createSnippetsMenuInstance(options={}) { const snippetsEditor = await requireWysiwygLegacyModule('@web_editor/js/editor/snippets.editor'); - const { SnippetsMenu } = snippetsEditor[Symbol.for("default")]; + const { SnippetsMenu } = snippetsEditor; return new SnippetsMenu(this, Object.assign({ wysiwyg: this, selectorEditableArea: '.o_editable', diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg_iframe.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg_iframe.js index e2702691b0f14..b1d95caa5f08d 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg_iframe.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg_iframe.js @@ -221,17 +221,17 @@ function getWysiwygIframeContent(params) { return window.top.odoo.__DEBUG__.services['web.session']; }); - odoo.define('root.widget', ['web.Widget'], function (require) { + odoo.define('root.widget', ['@web/legacy/js/core/widget'], function (require) { 'use strict'; - var Widget = require('web.Widget'); + var Widget = require('@web/legacy/js/core/widget')[Symbol.for("default")]; var widget = new Widget(); widget.appendTo(document.body); return widget; }); - odoo.define('web.core.top', ['web.core'], function (require) { - var core = require('web.core'); - core.qweb.templates = window.top.odoo.__DEBUG__.services['web.core'].qweb.templates; + odoo.define('web.core.top', ['@web/legacy/js/services/core'], function (require) { + var core = require('@web/legacy/js/services/core')[Symbol.for("default")]; + core.qweb.templates = window.top.odoo.__DEBUG__.services['@web/legacy/js/services/core'].qweb.templates; }); diff --git a/addons/web_editor/static/tests/convert_inline_tests.js b/addons/web_editor/static/tests/convert_inline_tests.js index 8455ef76bdd38..153adfd71ab61 100644 --- a/addons/web_editor/static/tests/convert_inline_tests.js +++ b/addons/web_editor/static/tests/convert_inline_tests.js @@ -1,6 +1,6 @@ /** @odoo-module **/ import convertInline from '@web_editor/js/backend/convert_inline'; -import {getGridHtml, getTableHtml, getRegularGridHtml, getRegularTableHtml, getTdHtml, removeComments} from 'web_editor.test_utils'; +import {getGridHtml, getTableHtml, getRegularGridHtml, getRegularTableHtml, getTdHtml, removeComments} from '@web_editor/../tests/test_utils'; const TEST_WIDTH = 800; const TEST_HEIGHT = 600; diff --git a/addons/web_editor/static/tests/html_field_tests.js b/addons/web_editor/static/tests/html_field_tests.js index cee93cb1699fc..a39aceb2c9156 100644 --- a/addons/web_editor/static/tests/html_field_tests.js +++ b/addons/web_editor/static/tests/html_field_tests.js @@ -6,10 +6,10 @@ import { FormController } from '@web/views/form/form_controller'; import { HtmlField } from "@web_editor/js/backend/html_field"; import { parseHTML } from "@web_editor/js/editor/odoo-editor/src/utils/utils"; import { onRendered } from "@odoo/owl"; -import { wysiwygData } from "web_editor.test_utils"; +import { wysiwygData } from "@web_editor/../tests/test_utils"; // Legacy -import legacyEnv from 'web.commonEnv'; +import legacyEnv from '@web/legacy/js/common_env'; async function iframeReady(iframe) { const iframeLoadPromise = makeDeferred(); diff --git a/addons/web_editor/static/tests/test_utils.js b/addons/web_editor/static/tests/test_utils.js index e6b160a4bacaa..4a08a389de6f2 100644 --- a/addons/web_editor/static/tests/test_utils.js +++ b/addons/web_editor/static/tests/test_utils.js @@ -1,13 +1,13 @@ -/** @odoo-module alias=web_editor.test_utils **/ +/** @odoo-module **/ -import ajax from "web.ajax"; +import ajax from "@web/legacy/js/core/ajax"; import { MockServer } from "@web/../tests/helpers/mock_server"; -import MockServerLegacy from "web.MockServer"; -import testUtils from "web.test_utils"; +import MockServerLegacy from "@web/../tests/legacy/helpers/mock_server"; +import testUtils from "@web/../tests/legacy/helpers/test_utils"; import * as coreUtils from "@web/core/utils/patch"; import * as OdooEditorLib from "@web_editor/js/editor/odoo-editor/src/OdooEditor"; import { Wysiwyg } from '@web_editor/js/wysiwyg/wysiwyg'; -import options from "web_editor.snippets.options"; +import options from "@web_editor/js/editor/snippets.options"; import { range } from "@web/core/utils/numbers"; import { TABLE_ATTRIBUTES, TABLE_STYLES } from '@web_editor/js/backend/convert_inline'; @@ -198,7 +198,7 @@ function unpatch() { * @param {object} data * @returns {object} */ -function wysiwygData(data) { +export function wysiwygData(data) { return Object.assign({ 'ir.ui.view': { fields: { @@ -718,7 +718,7 @@ const tableStylesString = Object.keys(TABLE_STYLES).map(key => `${key}: ${TABLE_ * @param {Array>} matrix * @returns {string} */ -function getGridHtml(matrix) { +export function getGridHtml(matrix) { return ( `
` + matrix.map((row, iRow) => ( @@ -731,7 +731,7 @@ function getGridHtml(matrix) { `
` ); } -function getTdHtml(colspan, text, containerWidth) { +export function getTdHtml(colspan, text, containerWidth) { return ( `` + matrix.map((row, iRow) => ( @@ -788,7 +788,7 @@ function getTableHtml(matrix, containerWidth) { * @param {Number|Number[]} nCols * @returns {string} */ -function getRegularGridHtml(nRows, nCols) { +export function getRegularGridHtml(nRows, nCols) { const matrix = new Array(nRows).fill().map((_, iRow) => ( new Array(Array.isArray(nCols) ? nCols[iRow] : nCols).fill() )); @@ -810,7 +810,7 @@ function getRegularGridHtml(nRows, nCols) { * @param {Number} containerWidth * @returns {string} */ -function getRegularTableHtml(nRows, nCols, colspan, width, containerWidth) { +export function getRegularTableHtml(nRows, nCols, colspan, width, containerWidth) { const matrix = new Array(nRows).fill().map((_, iRow) => ( new Array(Array.isArray(nCols) ? nCols[iRow] : nCols).fill().map(() => ([ Array.isArray(colspan) ? colspan[iRow] : colspan, @@ -828,7 +828,7 @@ function getRegularTableHtml(nRows, nCols, colspan, width, containerWidth) { * @param {boolean} [removeMsoHide=true] * @returns {string} */ -function removeComments(html, removeMsoHide=true) { +export function removeComments(html, removeMsoHide=true) { const cleanHtml = html.replace(//g, ''); if (removeMsoHide) { return cleanHtml.replaceAll(' class="mso-hide"', '').replace(/\s*mso-hide/g, '').replace(/mso-hide\s*/g, ''); diff --git a/addons/web_editor/static/tests/utils_tests.js b/addons/web_editor/static/tests/utils_tests.js index ac0662236cb06..3aac9f0cf60b9 100644 --- a/addons/web_editor/static/tests/utils_tests.js +++ b/addons/web_editor/static/tests/utils_tests.js @@ -1,5 +1,5 @@ /** @odoo-module **/ -import weUtils from 'web_editor.utils'; +import weUtils from '@web_editor/js/common/utils'; QUnit.module('web_editor', {}, function () { QUnit.module('utils', {}, function () { diff --git a/addons/web_tour/static/src/tour_service/tour_service.js b/addons/web_tour/static/src/tour_service/tour_service.js index 7528b97d46d9d..8a188684ee13e 100644 --- a/addons/web_tour/static/src/tour_service/tour_service.js +++ b/addons/web_tour/static/src/tour_service/tour_service.js @@ -59,7 +59,7 @@ export const tourService = { dependencies: ["orm", "effect", "ui", "localization"], start: async (_env, { orm, effect, ui }) => { await whenReady(); - await odoo.ready("web.legacy_tranlations_loaded"); + await odoo.ready("@web/legacy/translations_loaded"); /** @type {{ [k: string]: Tour }} */ const tours = {}; diff --git a/addons/web_unsplash/static/src/components/media_dialog/image_selector.js b/addons/web_unsplash/static/src/components/media_dialog/image_selector.js index 8b75650785ca6..4ed497b925e0a 100644 --- a/addons/web_unsplash/static/src/components/media_dialog/image_selector.js +++ b/addons/web_unsplash/static/src/components/media_dialog/image_selector.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import { patch } from 'web.utils'; +import { patch } from '@web/legacy/js/core/utils'; import { KeepLast } from "@web/core/utils/concurrency"; import { MediaDialog, TABS } from '@web_editor/components/media_dialog/media_dialog'; import { ImageSelector } from '@web_editor/components/media_dialog/image_selector'; diff --git a/addons/web_unsplash/static/src/js/unsplash_beacon.js b/addons/web_unsplash/static/src/js/unsplash_beacon.js index 79de88ea9d18b..dc2fef5dcc199 100644 --- a/addons/web_unsplash/static/src/js/unsplash_beacon.js +++ b/addons/web_unsplash/static/src/js/unsplash_beacon.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import publicWidget from "web.public.widget"; +import publicWidget from "@web/legacy/js/public/public_widget"; publicWidget.registry.UnsplashBeacon = publicWidget.Widget.extend({ // /!\ To adapt the day the beacon makes sense for backend customizations diff --git a/addons/website/static/lib/multirange/multirange_custom.js b/addons/website/static/lib/multirange/multirange_custom.js index cc3348529cc03..c4864989f477a 100644 --- a/addons/website/static/lib/multirange/multirange_custom.js +++ b/addons/website/static/lib/multirange/multirange_custom.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=website_sale.multirange **/ +/** @odoo-module **/ /** * This code has been more that widely inspired by the multirange library * which can be found on https://github.com/LeaVerou/multirange. diff --git a/addons/website/static/lib/multirange/multirange_instance.js b/addons/website/static/lib/multirange/multirange_instance.js index d79b098a45f8d..9036ffa4cb0d6 100644 --- a/addons/website/static/lib/multirange/multirange_instance.js +++ b/addons/website/static/lib/multirange/multirange_instance.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=website_sale.multirange.instance **/ +/** @odoo-module **/ -import publicWidget from "web.public.widget"; -import multirange from "website_sale.multirange"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import multirange from "@website/../lib/multirange/multirange_custom"; publicWidget.registry.WebsiteMultirangeInputs = publicWidget.Widget.extend({ selector: 'input[type=range][multiple]:not(.multirange)', diff --git a/addons/website/static/src/client_actions/configurator/configurator.js b/addons/website/static/src/client_actions/configurator/configurator.js index 6f35c252d0141..7c79f775a3e58 100644 --- a/addons/website/static/src/client_actions/configurator/configurator.js +++ b/addons/website/static/src/client_actions/configurator/configurator.js @@ -1,10 +1,10 @@ /** @odoo-module **/ -import concurrency from 'web.concurrency'; -import utils from 'web.utils'; -import weUtils from 'web_editor.utils'; -import {_lt} from 'web.core'; -import {svgToPNG} from 'website.utils'; +import concurrency from '@web/legacy/js/core/concurrency'; +import utils from '@web/legacy/js/core/utils'; +import weUtils from '@web_editor/js/common/utils'; +import {_lt} from "@web/legacy/js/services/core"; +import {svgToPNG} from '@website/js/utils'; import { useService } from "@web/core/utils/hooks"; import { registry } from "@web/core/registry"; import { mixCssColors } from '@web/core/utils/colors'; diff --git a/addons/website/static/src/client_actions/website_preview/website_preview.js b/addons/website/static/src/client_actions/website_preview/website_preview.js index f8e1f8aa16bf6..a7072f40f59ab 100644 --- a/addons/website/static/src/client_actions/website_preview/website_preview.js +++ b/addons/website/static/src/client_actions/website_preview/website_preview.js @@ -3,7 +3,7 @@ import { browser } from '@web/core/browser/browser'; import { registry } from '@web/core/registry'; import { useService, useBus } from '@web/core/utils/hooks'; -import core from 'web.core'; +import core from "@web/legacy/js/services/core"; import { AceEditorAdapterComponent } from '../../components/ace_editor/ace_editor'; import { WebsiteEditorComponent } from '../../components/editor/editor'; import { WebsiteTranslator } from '../../components/translator/translator'; @@ -13,8 +13,8 @@ import { WebsiteDialog } from "@website/components/dialog/dialog"; import { routeToUrl } from "@web/core/browser/router_service"; import { getActiveHotkey } from "@web/core/hotkeys/hotkey_service"; import { sprintf } from "@web/core/utils/strings"; -import wUtils from 'website.utils'; -import config from "web.config"; +import wUtils from '@website/js/utils'; +import config from "@web/legacy/js/services/config"; const { Component, onWillStart, onMounted, onWillUnmount, useRef, useEffect, useState } = owl; @@ -111,7 +111,7 @@ export class WebsitePreview extends Component { this.websiteService.showLoader({ showTips: true }); } }, () => [this.props.action.context.params]); - + useEffect(() => { this.websiteContext.showAceEditor = false; }, () => [ diff --git a/addons/website/static/src/client_actions/website_preview/website_preview_test_mode.js b/addons/website/static/src/client_actions/website_preview/website_preview_test_mode.js index 8b762b55dfa49..52f4505dd810f 100644 --- a/addons/website/static/src/client_actions/website_preview/website_preview_test_mode.js +++ b/addons/website/static/src/client_actions/website_preview/website_preview_test_mode.js @@ -1,5 +1,5 @@ /** @odoo-module **/ -import { patch } from 'web.utils'; +import { patch } from '@web/legacy/js/core/utils'; import { WebsitePreview } from '@website/client_actions/website_preview/website_preview'; patch(WebsitePreview.prototype, 'website_preview_test_mode', { diff --git a/addons/website/static/src/components/ace_editor/ace_editor.js b/addons/website/static/src/components/ace_editor/ace_editor.js index b2ced1cd32448..fa6fb5d001388 100644 --- a/addons/website/static/src/components/ace_editor/ace_editor.js +++ b/addons/website/static/src/components/ace_editor/ace_editor.js @@ -1,8 +1,8 @@ /** @odoo-module */ -import {ComponentAdapter} from 'web.OwlCompatibility'; +import {ComponentAdapter} from '@web/legacy/js/owl_compatibility'; import {useService} from '@web/core/utils/hooks'; -import AceEditor from 'web_editor.ace'; +import AceEditor from '@web_editor/js/common/ace'; const {Component} = owl; diff --git a/addons/website/static/src/components/burger_menu/burger_menu.js b/addons/website/static/src/components/burger_menu/burger_menu.js index feaa3ad0ae81e..ba15e5a009e45 100644 --- a/addons/website/static/src/components/burger_menu/burger_menu.js +++ b/addons/website/static/src/components/burger_menu/burger_menu.js @@ -3,7 +3,7 @@ import { BurgerMenu } from '@web/webclient/burger_menu/burger_menu'; import { useService } from '@web/core/utils/hooks'; import { registry } from "@web/core/registry"; -import { patch } from 'web.utils'; +import { patch } from '@web/legacy/js/core/utils'; const websiteSystrayRegistry = registry.category('website_systray'); diff --git a/addons/website/static/src/components/dialog/dialog.js b/addons/website/static/src/components/dialog/dialog.js index de68b295b2583..0b9d0a6ab1d13 100644 --- a/addons/website/static/src/components/dialog/dialog.js +++ b/addons/website/static/src/components/dialog/dialog.js @@ -5,7 +5,7 @@ import { Dialog } from '@web/core/dialog/dialog'; import { _lt } from '@web/core/l10n/translation'; import { Switch } from '@website/components/switch/switch'; import {unslugHtmlDataObject} from '../../services/website_service'; -import { csrf_token } from 'web.core'; +import { csrf_token } from "@web/legacy/js/services/core"; const { xml, useState, Component, onWillStart } = owl; diff --git a/addons/website/static/src/components/dialog/edit_menu.js b/addons/website/static/src/components/dialog/edit_menu.js index 0925a18db22bc..f75e8dceb0c55 100644 --- a/addons/website/static/src/components/dialog/edit_menu.js +++ b/addons/website/static/src/components/dialog/edit_menu.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { useService, useAutofocus } from '@web/core/utils/hooks'; -import wUtils from 'website.utils'; +import wUtils from '@website/js/utils'; import { WebsiteDialog } from './dialog'; const { Component, useState, useEffect, onWillStart, useRef, onMounted } = owl; diff --git a/addons/website/static/src/components/dialog/page_properties.js b/addons/website/static/src/components/dialog/page_properties.js index 8cbb1b9c338a4..46b309a13883c 100644 --- a/addons/website/static/src/components/dialog/page_properties.js +++ b/addons/website/static/src/components/dialog/page_properties.js @@ -7,7 +7,7 @@ import {sprintf} from "@web/core/utils/strings"; import {useWowlService} from '@web/legacy/utils'; import {WebsiteDialog} from './dialog'; import {FormViewDialog} from "@web/views/view_dialogs/form_view_dialog"; -import { qweb } from 'web.core'; +import { qweb } from "@web/legacy/js/services/core"; const { Component, useEffect, useState, xml, useRef } = owl; diff --git a/addons/website/static/src/components/navbar/navbar.js b/addons/website/static/src/components/navbar/navbar.js index 4650305c034e1..48011944397fa 100644 --- a/addons/website/static/src/components/navbar/navbar.js +++ b/addons/website/static/src/components/navbar/navbar.js @@ -3,7 +3,7 @@ import { NavBar } from '@web/webclient/navbar/navbar'; import { useService, useBus } from '@web/core/utils/hooks'; import { registry } from "@web/core/registry"; -import { patch } from 'web.utils'; +import { patch } from '@web/legacy/js/core/utils'; const websiteSystrayRegistry = registry.category('website_systray'); const { useEffect } = owl; diff --git a/addons/website/static/src/components/translator/translator.js b/addons/website/static/src/components/translator/translator.js index 5d0e7e986b7d2..e6ddb2e971ac3 100644 --- a/addons/website/static/src/components/translator/translator.js +++ b/addons/website/static/src/components/translator/translator.js @@ -2,7 +2,7 @@ import { useService } from '@web/core/utils/hooks'; import { WebsiteEditorComponent } from '../editor/editor'; import { WebsiteDialog } from '../dialog/dialog'; -import localStorage from 'web.local_storage'; +import localStorage from '@web/legacy/js/core/local_storage'; const { useEffect, useRef, Component, xml } = owl; diff --git a/addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js b/addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js index 0e5d923f7786a..8e1beca3b696b 100644 --- a/addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js +++ b/addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js @@ -1,12 +1,12 @@ /** @odoo-module */ -import legacyEnv from 'web.commonEnv'; +import legacyEnv from '@web/legacy/js/common_env'; import { useService, useBus } from "@web/core/utils/hooks"; import { useHotkey } from '@web/core/hotkeys/hotkey_hook'; import { Wysiwyg } from "@web_editor/js/wysiwyg/wysiwyg"; import { requireWysiwygLegacyModule } from "@web_editor/js/frontend/loader"; -import { setEditableWindow } from 'web_editor.utils'; +import weUtils from '@web_editor/js/common/utils'; import { EditMenuDialog, MenuDialog } from "../dialog/edit_menu"; import { WebsiteDialog } from '../dialog/dialog'; @@ -106,7 +106,7 @@ export class WysiwygAdapterComponent extends Wysiwyg { // Set utils functions' editable window to the current iframe's window. // This allows those function to access the correct styles definitions, // document element, etc. - setEditableWindow(this.websiteService.contentWindow); + weUtils.setEditableWindow(this.websiteService.contentWindow); this.switchableRelatedViews = Promise.resolve(switchableRelatedViews); }); @@ -139,7 +139,7 @@ export class WysiwygAdapterComponent extends Wysiwyg { if (this.dummyWidgetEl) { this.dummyWidgetEl.remove(); document.body.classList.remove('editor_has_dummy_snippets'); - setEditableWindow(window); + weUtils.setEditableWindow(window); } }); } @@ -324,10 +324,10 @@ export class WysiwygAdapterComponent extends Wysiwyg { // It would also survive (multi) website switch, not fetching the values // from the accessed website. const mod = await requireWysiwygLegacyModule('@website/snippets/s_social_media/options'); - mod[Symbol.for('default')].clearDbSocialValuesCache(); + mod.clearDbSocialValuesCache(); const formOptionsMod = await requireWysiwygLegacyModule('@website/snippets/s_website_form/options'); - formOptionsMod[Symbol.for('default')].clearAllFormsInfo(); + formOptionsMod.clearAllFormsInfo(); this._restoreMegaMenus(); return super.destroy(...arguments); @@ -849,7 +849,7 @@ export class WysiwygAdapterComponent extends Wysiwyg { */ async _createSnippetsMenuInstance(options = {}) { const snippetsEditor = await requireWysiwygLegacyModule('@website/js/editor/snippets.editor'); - const { SnippetsMenu } = snippetsEditor[Symbol.for("default")]; + const { SnippetsMenu } = snippetsEditor; return new SnippetsMenu(this, Object.assign({ wysiwyg: this, selectorEditableArea: '.o_editable', diff --git a/addons/website/static/src/js/content/compatibility.js b/addons/website/static/src/js/content/compatibility.js index f99ab224665be..5b502b22006b4 100644 --- a/addons/website/static/src/js/content/compatibility.js +++ b/addons/website/static/src/js/content/compatibility.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=website.content.compatibility **/ +/** @odoo-module **/ /** * Tweaks the website rendering so that the old browsers correctly render the diff --git a/addons/website/static/src/js/content/inject_dom.js b/addons/website/static/src/js/content/inject_dom.js index f96644a395852..cb9ae83b46016 100644 --- a/addons/website/static/src/js/content/inject_dom.js +++ b/addons/website/static/src/js/content/inject_dom.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import {getCookie} from 'web.utils.cookies'; +import {getCookie} from '@web/legacy/js/core/cookie_utils'; import { session } from '@web/session'; document.addEventListener('DOMContentLoaded', () => { diff --git a/addons/website/static/src/js/content/menu.js b/addons/website/static/src/js/content/menu.js index 48b98f1d06c03..c7565e20d64a5 100644 --- a/addons/website/static/src/js/content/menu.js +++ b/addons/website/static/src/js/content/menu.js @@ -1,10 +1,10 @@ -/** @odoo-module alias=website.content.menu **/ +/** @odoo-module **/ -import config from "web.config"; -import publicWidget from "web.public.widget"; -import animations from "website.content.snippets.animation"; -const extraMenuUpdateCallbacks = []; -import dom from "web.dom"; +import config from "@web/legacy/js/services/config"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import animations from "@website/js/content/snippets.animation"; +export const extraMenuUpdateCallbacks = []; +import dom from "@web/legacy/js/core/dom"; const BaseAnimatedHeader = animations.Animation.extend({ disabledInEditableMode: false, diff --git a/addons/website/static/src/js/content/ripple_effect.js b/addons/website/static/src/js/content/ripple_effect.js index 65f89075c31c1..ca305f8f7966f 100644 --- a/addons/website/static/src/js/content/ripple_effect.js +++ b/addons/website/static/src/js/content/ripple_effect.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import publicWidget from "web.public.widget"; +import publicWidget from "@web/legacy/js/public/public_widget"; publicWidget.registry.RippleEffect = publicWidget.Widget.extend({ selector: '.btn, .dropdown-toggle, .dropdown-item', diff --git a/addons/website/static/src/js/content/snippets.animation.js b/addons/website/static/src/js/content/snippets.animation.js index 577aef1314d38..40f025790d985 100644 --- a/addons/website/static/src/js/content/snippets.animation.js +++ b/addons/website/static/src/js/content/snippets.animation.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=website.content.snippets.animation **/ +/** @odoo-module **/ /** * Provides a way to start JS code for snippets' initialization and animations. @@ -8,13 +8,13 @@ import { loadJS } from "@web/core/assets"; import { uniqueId } from "@web/core/utils/functions"; import { escape } from "@web/core/utils/strings"; import { debounce, throttleForAnimation } from "@web/core/utils/timing"; -import Class from "web.Class"; -import config from "web.config"; -import core from "web.core"; -import dom from "web.dom"; -import mixins from "web.mixins"; -import publicWidget from "web.public.widget"; -import wUtils from "website.utils"; +import Class from "@web/legacy/js/core/class"; +import config from "@web/legacy/js/services/config"; +import core from "@web/legacy/js/services/core"; +import dom from "@web/legacy/js/core/dom"; +import mixins from "@web/legacy/js/core/mixins"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import wUtils from "@website/js/utils"; var qweb = core.qweb; diff --git a/addons/website/static/src/js/content/website_root.js b/addons/website/static/src/js/content/website_root.js index c0df31eff56ea..21340fef372f2 100644 --- a/addons/website/static/src/js/content/website_root.js +++ b/addons/website/static/src/js/content/website_root.js @@ -1,12 +1,12 @@ -/** @odoo-module alias=website.root */ +/** @odoo-module */ import { loadJS } from "@web/core/assets"; -import { _t } from 'web.core'; -import KeyboardNavigationMixin from 'web.KeyboardNavigationMixin'; -import {Markup} from 'web.utils'; +import { _t } from "@web/legacy/js/services/core"; +import KeyboardNavigationMixin from '@web/legacy/frontend/keyboard_navigation_mixin'; +import { Markup } from '@web/legacy/js/core/utils'; import session from 'web.session'; -import publicRootData from 'web.public.root'; -import "web.zoomodoo"; +import publicRootData from '@web/legacy/js/public/public_root'; +import "@web/legacy/js/libs/zoomodoo"; import { pick } from "@web/core/utils/objects"; export const WebsiteRoot = publicRootData.PublicRoot.extend(KeyboardNavigationMixin, { diff --git a/addons/website/static/src/js/editor/editor.js b/addons/website/static/src/js/editor/editor.js index 06cd4dceb5ed9..b9ed31f3b5d18 100644 --- a/addons/website/static/src/js/editor/editor.js +++ b/addons/website/static/src/js/editor/editor.js @@ -3,7 +3,7 @@ import { LinkDialog } from "@web_editor/js/wysiwyg/widgets/link_dialog"; import { patch } from "@web/core/utils/patch"; import { useService } from "@web/core/utils/hooks"; -import wUtils from 'website.utils'; +import wUtils from "@website/js/utils"; patch(LinkDialog.prototype, "editor.js", { setup() { diff --git a/addons/website/static/src/js/editor/snippets.editor.js b/addons/website/static/src/js/editor/snippets.editor.js index 2eee3d24679bb..82476244b8f46 100644 --- a/addons/website/static/src/js/editor/snippets.editor.js +++ b/addons/website/static/src/js/editor/snippets.editor.js @@ -1,9 +1,9 @@ -/** @odoo-module alias=website.snippet.editor **/ +/** @odoo-modules **/ -import {qweb, _t, _lt} from "web.core"; -import Dialog from "web.Dialog"; -import weSnippetEditor from "web_editor.snippet.editor"; -import wSnippetOptions from "website.editor.snippets.options"; +import {qweb, _t, _lt} from "@web/legacy/js/services/core"; +import Dialog from "@web/legacy/js/core/dialog"; +import weSnippetEditor from "@web_editor/js/editor/snippets.editor"; +import wSnippetOptions from "@website/js/editor/snippets.options"; import * as OdooEditorLib from "@web_editor/js/editor/odoo-editor/src/utils/utils"; const getDeepRange = OdooEditorLib.getDeepRange; const getTraversedNodes = OdooEditorLib.getTraversedNodes; diff --git a/addons/website/static/src/js/editor/snippets.options.js b/addons/website/static/src/js/editor/snippets.options.js index 94e83473ef814..36c292771b9b5 100644 --- a/addons/website/static/src/js/editor/snippets.options.js +++ b/addons/website/static/src/js/editor/snippets.options.js @@ -1,15 +1,15 @@ -/** @odoo-module alias=website.editor.snippets.options **/ +/** @odoo-module **/ -import core from "web.core"; +import core from "@web/legacy/js/services/core"; import { loadBundle, loadCSS } from "@web/core/assets"; -import Dialog from "web.Dialog"; -import {Markup, sprintf} from "web.utils"; -import weUtils from "web_editor.utils"; -import options from "web_editor.snippets.options"; +import Dialog from "@web/legacy/js/core/dialog"; +import { Markup, sprintf } from "@web/legacy/js/core/utils"; +import weUtils from "@web_editor/js/common/utils"; +import options from "@web_editor/js/editor/snippets.options"; import { NavbarLinkPopoverWidget } from "@website/js/widgets/link_popover_widget"; -import wUtils from "website.utils"; -import {isImageSupportedForStyle} from "web_editor.image_processing"; -import "website.s_popup_options"; +import wUtils from "@website/js/utils"; +import {isImageSupportedForStyle} from "@web_editor/js/editor/image_processing"; +import "@website/snippets/s_popup/options"; import { range } from "@web/core/utils/numbers"; import {Domain} from "@web/core/domain"; import { @@ -2815,7 +2815,7 @@ options.registry.anchor = options.Class.extend({ }); }); }, - + /** * @private * @param {Element} buttonEl @@ -2974,8 +2974,8 @@ options.registry.CookiesBar = options.registry.SnippetPopup.extend({ })); const $content = this.$target.find('.modal-content'); - - // The order of selectors is significant since certain selectors may be + + // The order of selectors is significant since certain selectors may be // nested within others, and we want to preserve the nested ones. // For instance, in the case of '.o_cookies_bar_text_policy' nested // inside '.o_cookies_bar_text_secondary', the parent selector should be diff --git a/addons/website/static/src/js/editor/widget_link.js b/addons/website/static/src/js/editor/widget_link.js index 793613f5de2f1..60d41e478b0b1 100644 --- a/addons/website/static/src/js/editor/widget_link.js +++ b/addons/website/static/src/js/editor/widget_link.js @@ -4,7 +4,7 @@ import { LinkTools } from '@web_editor/js/wysiwyg/widgets/link_tools'; import { patch } from "@web/core/utils/patch"; import { useService } from "@web/core/utils/hooks"; -import wUtils from "website.utils"; +import wUtils from "@website/js/utils"; import { debounce } from "@web/core/utils/timing"; const LINK_DEBOUNCE = 1000; diff --git a/addons/website/static/src/js/form_editor_registry.js b/addons/website/static/src/js/form_editor_registry.js index b7df9f672fbcd..c82ba941c6b5e 100644 --- a/addons/website/static/src/js/form_editor_registry.js +++ b/addons/website/static/src/js/form_editor_registry.js @@ -1,5 +1,5 @@ -/** @odoo-module alias=website.form_editor_registry **/ +/** @odoo-module **/ -import Registry from "web.Registry"; +import Registry from "@web/legacy/js/core/registry"; export default new Registry(); diff --git a/addons/website/static/src/js/http_cookie.js b/addons/website/static/src/js/http_cookie.js index 39adf7fd4be8a..525bfbe6e8530 100644 --- a/addons/website/static/src/js/http_cookie.js +++ b/addons/website/static/src/js/http_cookie.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import cookieUtils from 'web.utils.cookies'; +import cookieUtils from '@web/legacy/js/core/cookie_utils'; const originFunc = cookieUtils.isAllowedCookie; cookieUtils.isAllowedCookie = (type) => { diff --git a/addons/website/static/src/js/plausible.js b/addons/website/static/src/js/plausible.js index 72ddb281f528e..0f40c3f7dad32 100644 --- a/addons/website/static/src/js/plausible.js +++ b/addons/website/static/src/js/plausible.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import publicWidget from 'web.public.widget'; +import publicWidget from '@web/legacy/js/public/public_widget'; publicWidget.registry.o_plausible_push = publicWidget.Widget.extend({ selector: '.js_plausible_push', diff --git a/addons/website/static/src/js/post_link.js b/addons/website/static/src/js/post_link.js index a4abf15b88f79..64e8f5c73e3fa 100644 --- a/addons/website/static/src/js/post_link.js +++ b/addons/website/static/src/js/post_link.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import publicWidget from "web.public.widget"; -import wUtils from "website.utils"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import wUtils from "@website/js/utils"; publicWidget.registry.postLink = publicWidget.Widget.extend({ selector: '.post_link', diff --git a/addons/website/static/src/js/send_mail_form.js b/addons/website/static/src/js/send_mail_form.js index 308a1375016ca..bec76db333f80 100644 --- a/addons/website/static/src/js/send_mail_form.js +++ b/addons/website/static/src/js/send_mail_form.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { _lt } from "@web/core/l10n/translation"; -import FormEditorRegistry from "website.form_editor_registry"; +import FormEditorRegistry from "@website/js/form_editor_registry"; FormEditorRegistry.add('send_mail', { formFields: [{ diff --git a/addons/website/static/src/js/show_password.js b/addons/website/static/src/js/show_password.js index 7bb680b46b354..798ff3439d3e1 100644 --- a/addons/website/static/src/js/show_password.js +++ b/addons/website/static/src/js/show_password.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=website.show_password **/ +/** @odoo-module **/ // // This file is meant to allow to switch the type of an input #password @@ -7,7 +7,7 @@ // On mouse up, we hide it again. // -import publicWidget from "web.public.widget"; +import publicWidget from "@web/legacy/js/public/public_widget"; publicWidget.registry.ShowPassword = publicWidget.Widget.extend({ selector: '#showPass', diff --git a/addons/website/static/src/js/tours/configurator_tour.js b/addons/website/static/src/js/tours/configurator_tour.js index acb4ecb215a5f..b8f65b98fed46 100644 --- a/addons/website/static/src/js/tours/configurator_tour.js +++ b/addons/website/static/src/js/tours/configurator_tour.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import wTourUtils from "website.tour_utils"; -import core from "web.core"; -import "web.legacy_tranlations_loaded"; +import wTourUtils from "@website/js/tours/tour_utils"; +import core from "@web/legacy/js/services/core"; +import "@web/legacy/translations_loaded"; const _t = core._t; let titleSelector = '#wrap > section:first-child'; diff --git a/addons/website/static/src/js/tours/homepage.js b/addons/website/static/src/js/tours/homepage.js index 97f57151fb27b..e6cf3e48c8440 100644 --- a/addons/website/static/src/js/tours/homepage.js +++ b/addons/website/static/src/js/tours/homepage.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from "website.tour_utils"; +import wTourUtils from "@website/js/tours/tour_utils"; const snippets = [ { diff --git a/addons/website/static/src/js/tours/tour_utils.js b/addons/website/static/src/js/tours/tour_utils.js index 05b60aa8f58de..e13af0befdbb1 100644 --- a/addons/website/static/src/js/tours/tour_utils.js +++ b/addons/website/static/src/js/tours/tour_utils.js @@ -1,8 +1,8 @@ -/** @odoo-module alias=website.tour_utils **/ +/** @odoo-module **/ -import {_t} from "web.core"; -import "web.legacy_tranlations_loaded"; -import {Markup} from "web.utils"; +import {_t} from "@web/legacy/js/services/core"; +import "@web/legacy/translations_loaded"; +import { Markup } from "@web/legacy/js/core/utils"; import { registry } from "@web/core/registry"; import { sprintf } from "@web/core/utils/strings"; diff --git a/addons/website/static/src/js/user_custom_javascript.js b/addons/website/static/src/js/user_custom_javascript.js index c702961ac6291..5d9827033dc4b 100644 --- a/addons/website/static/src/js/user_custom_javascript.js +++ b/addons/website/static/src/js/user_custom_javascript.js @@ -7,8 +7,8 @@ // world !' message in a popup: // /* -import Dialog from 'web.Dialog'; -import publicWidget from 'web.public.widget'; +import Dialog from '@web/legacy/js/core/dialog'; +import publicWidget from '@web/legacy/js/public/public_widget'; publicWidget.registry.HelloWorldPopup = publicWidget.Widget.extend({ selector: '#wrapwrap', diff --git a/addons/website/static/src/js/utils.js b/addons/website/static/src/js/utils.js index 3712656df4c77..a7f0c3abafdfb 100644 --- a/addons/website/static/src/js/utils.js +++ b/addons/website/static/src/js/utils.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=website.utils **/ +/** @odoo-module **/ import { intersection } from "@web/core/utils/arrays"; -import core from "web.core"; +import core from "@web/legacy/js/services/core"; const { qweb, _t } = core; @@ -317,7 +317,7 @@ function sendRequest(route, params) { * efficient in that second case. * @returns {Promise} a base64 PNG (as result of a Promise) */ -async function svgToPNG(src) { +export async function svgToPNG(src) { function checkImg(imgEl) { // Firefox does not support drawing SVG to canvas unless it has width // and height attributes set on the root . @@ -390,7 +390,7 @@ async function svgToPNG(src) { * * @returns {HTMLIframeElement} */ -function generateGMapIframe() { +export function generateGMapIframe() { const iframeEl = document.createElement('iframe'); iframeEl.classList.add('s_map_embedded', 'o_not_editable'); iframeEl.setAttribute('width', '100%'); @@ -409,7 +409,7 @@ function generateGMapIframe() { * @param {DOMStringMap} dataset * @returns {string} a Google Maps URL */ -function generateGMapLink(dataset) { +export function generateGMapLink(dataset) { return 'https://maps.google.com/maps?q=' + encodeURIComponent(dataset.mapAddress) + '&t=' + encodeURIComponent(dataset.mapType) + '&z=' + encodeURIComponent(dataset.mapZoom) diff --git a/addons/website/static/src/js/widgets/dialog.js b/addons/website/static/src/js/widgets/dialog.js index df7eb514ed873..41d7b5e5ef192 100644 --- a/addons/website/static/src/js/widgets/dialog.js +++ b/addons/website/static/src/js/widgets/dialog.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import Dialog from 'web.Dialog'; +import Dialog from '@web/legacy/js/core/dialog'; Dialog.include({ diff --git a/addons/website/static/src/snippets/s_blockquote/options.js b/addons/website/static/src/snippets/s_blockquote/options.js index be8e0c3edd87c..8eff09250c35b 100644 --- a/addons/website/static/src/snippets/s_blockquote/options.js +++ b/addons/website/static/src/snippets/s_blockquote/options.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import options from "web_editor.snippets.options"; +import options from "@web_editor/js/editor/snippets.options"; options.registry.Blockquote = options.Class.extend({ diff --git a/addons/website/static/src/snippets/s_chart/000.js b/addons/website/static/src/snippets/s_chart/000.js index 0d9ebd4f91e1b..08dfce3b131ac 100644 --- a/addons/website/static/src/snippets/s_chart/000.js +++ b/addons/website/static/src/snippets/s_chart/000.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=website.s_chart **/ +/** @odoo-module **/ -import publicWidget from "web.public.widget"; -import weUtils from "web_editor.utils"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import weUtils from "@web_editor/js/common/utils"; const ChartWidget = publicWidget.Widget.extend({ selector: '.s_chart', diff --git a/addons/website/static/src/snippets/s_chart/options.js b/addons/website/static/src/snippets/s_chart/options.js index 1de939788b194..ba79bb3eb6914 100644 --- a/addons/website/static/src/snippets/s_chart/options.js +++ b/addons/website/static/src/snippets/s_chart/options.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import core from "web.core"; -import options from "web_editor.snippets.options"; -import weUtils from "web_editor.utils"; +import core from "@web/legacy/js/services/core"; +import options from "@web_editor/js/editor/snippets.options"; +import weUtils from "@web_editor/js/common/utils"; import { isCSSColor } from '@web/core/utils/colors'; var _t = core._t; diff --git a/addons/website/static/src/snippets/s_countdown/000.js b/addons/website/static/src/snippets/s_countdown/000.js index 3b00148043c62..cfd70b339be14 100644 --- a/addons/website/static/src/snippets/s_countdown/000.js +++ b/addons/website/static/src/snippets/s_countdown/000.js @@ -1,8 +1,8 @@ -/** @odoo-module alias=website.s_countdown **/ +/** @odoo-module **/ -import core from "web.core"; -import publicWidget from "web.public.widget"; -import weUtils from "web_editor.utils"; +import core from "@web/legacy/js/services/core"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import weUtils from "@web_editor/js/common/utils"; import { isCSSColor } from '@web/core/utils/colors'; const qweb = core.qweb; diff --git a/addons/website/static/src/snippets/s_countdown/options.js b/addons/website/static/src/snippets/s_countdown/options.js index 541f98b5279e9..09571c28cc486 100644 --- a/addons/website/static/src/snippets/s_countdown/options.js +++ b/addons/website/static/src/snippets/s_countdown/options.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import core from "web.core"; -import options from "web_editor.snippets.options"; +import core from "@web/legacy/js/services/core"; +import options from "@web_editor/js/editor/snippets.options"; const qweb = core.qweb; diff --git a/addons/website/static/src/snippets/s_dynamic_snippet/000.js b/addons/website/static/src/snippets/s_dynamic_snippet/000.js index 9f7e340c57e9d..1faf8e278a125 100644 --- a/addons/website/static/src/snippets/s_dynamic_snippet/000.js +++ b/addons/website/static/src/snippets/s_dynamic_snippet/000.js @@ -1,9 +1,9 @@ -/** @odoo-module alias=website.s_dynamic_snippet **/ +/** @odoo-module **/ -import core from "web.core"; -import config from "web.config"; -import publicWidget from "web.public.widget"; -import {Markup} from "web.utils"; +import core from "@web/legacy/js/services/core"; +import config from "@web/legacy/js/services/config"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import { Markup } from "@web/legacy/js/core/utils"; import { uniqueId } from "@web/core/utils/functions"; const DEFAULT_NUMBER_OF_ELEMENTS = 4; const DEFAULT_NUMBER_OF_ELEMENTS_SM = 1; @@ -235,7 +235,7 @@ const DynamicSnippet = publicWidget.Widget.extend({ * Called when the size has reached a new bootstrap breakpoint. * * @private - * @param {number} size as Integer @see web.config.device.SIZES + * @param {number} size as Integer @see @web/legacy/js/services/config.device.SIZES */ _onSizeChanged: function (size) { if (this.isDesplayedAsMobile !== config.device.isMobile) { diff --git a/addons/website/static/src/snippets/s_dynamic_snippet/options.js b/addons/website/static/src/snippets/s_dynamic_snippet/options.js index e263847d8bd24..24951d3e39e52 100644 --- a/addons/website/static/src/snippets/s_dynamic_snippet/options.js +++ b/addons/website/static/src/snippets/s_dynamic_snippet/options.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=website.s_dynamic_snippet_options **/ +/** @odoo-module **/ -import options from "web_editor.snippets.options"; +import options from "@web_editor/js/editor/snippets.options"; const dynamicSnippetOptions = options.Class.extend({ /** diff --git a/addons/website/static/src/snippets/s_dynamic_snippet_carousel/000.js b/addons/website/static/src/snippets/s_dynamic_snippet_carousel/000.js index 33e004c28bef0..0913bf815b83d 100644 --- a/addons/website/static/src/snippets/s_dynamic_snippet_carousel/000.js +++ b/addons/website/static/src/snippets/s_dynamic_snippet_carousel/000.js @@ -1,8 +1,8 @@ -/** @odoo-module alias=website.s_dynamic_snippet_carousel **/ +/** @odoo-module **/ -import publicWidget from "web.public.widget"; -import DynamicSnippet from "website.s_dynamic_snippet"; -import config from "web.config"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import DynamicSnippet from "@website/snippets/s_dynamic_snippet/000"; +import config from "@web/legacy/js/services/config"; const DynamicSnippetCarousel = DynamicSnippet.extend({ selector: '.s_dynamic_snippet_carousel', diff --git a/addons/website/static/src/snippets/s_dynamic_snippet_carousel/options.js b/addons/website/static/src/snippets/s_dynamic_snippet_carousel/options.js index 900bed4358dac..a95e0536d9cc6 100644 --- a/addons/website/static/src/snippets/s_dynamic_snippet_carousel/options.js +++ b/addons/website/static/src/snippets/s_dynamic_snippet_carousel/options.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=website.s_dynamic_snippet_carousel_options **/ +/** @odoo-module **/ -import options from "web_editor.snippets.options"; -import s_dynamic_snippet_options from "website.s_dynamic_snippet_options"; +import options from "@web_editor/js/editor/snippets.options"; +import s_dynamic_snippet_options from "@website/snippets/s_dynamic_snippet/options"; const dynamicSnippetCarouselOptions = s_dynamic_snippet_options.extend({ diff --git a/addons/website/static/src/snippets/s_embed_code/options.js b/addons/website/static/src/snippets/s_embed_code/options.js index cd05f628828ec..4e91f97d845a6 100644 --- a/addons/website/static/src/snippets/s_embed_code/options.js +++ b/addons/website/static/src/snippets/s_embed_code/options.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import Dialog from 'web.Dialog'; -import core from 'web.core'; -import options from 'web_editor.snippets.options'; +import Dialog from '@web/legacy/js/core/dialog'; +import core from "@web/legacy/js/services/core"; +import options from '@web_editor/js/editor/snippets.options'; import { loadBundle } from "@web/core/assets"; const _t = core._t; diff --git a/addons/website/static/src/snippets/s_facebook_page/000.js b/addons/website/static/src/snippets/s_facebook_page/000.js index c2a973e2ed440..cc9e39d58365a 100644 --- a/addons/website/static/src/snippets/s_facebook_page/000.js +++ b/addons/website/static/src/snippets/s_facebook_page/000.js @@ -1,8 +1,8 @@ -/** @odoo-module alias=website.s_facebook_page **/ +/** @odoo-module **/ import { pick } from "@web/core/utils/objects"; -import publicWidget from "web.public.widget"; -import utils from "web.utils"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import utils from "@web/legacy/js/core/utils"; const FacebookPageWidget = publicWidget.Widget.extend({ selector: '.o_facebook_page', diff --git a/addons/website/static/src/snippets/s_facebook_page/options.js b/addons/website/static/src/snippets/s_facebook_page/options.js index a4ec7d8dda4ca..600782f1a01f1 100644 --- a/addons/website/static/src/snippets/s_facebook_page/options.js +++ b/addons/website/static/src/snippets/s_facebook_page/options.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { pick } from "@web/core/utils/objects"; -import options from "web_editor.snippets.options"; +import options from "@web_editor/js/editor/snippets.options"; options.registry.facebookPage = options.Class.extend({ /** diff --git a/addons/website/static/src/snippets/s_google_map/000.js b/addons/website/static/src/snippets/s_google_map/000.js index 13395b26a5fad..8fcb865398e94 100644 --- a/addons/website/static/src/snippets/s_google_map/000.js +++ b/addons/website/static/src/snippets/s_google_map/000.js @@ -1,7 +1,7 @@ /** @odoo-module **/ /* global google */ -import publicWidget from "web.public.widget"; +import publicWidget from "@web/legacy/js/public/public_widget"; publicWidget.registry.GoogleMap = publicWidget.Widget.extend({ selector: '.s_google_map', diff --git a/addons/website/static/src/snippets/s_google_map/options.js b/addons/website/static/src/snippets/s_google_map/options.js index a11e8f2362913..a8cd7008d4c85 100644 --- a/addons/website/static/src/snippets/s_google_map/options.js +++ b/addons/website/static/src/snippets/s_google_map/options.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import {_t} from "web.core"; -import options from "web_editor.snippets.options"; +import {_t} from "@web/legacy/js/services/core"; +import options from "@web_editor/js/editor/snippets.options"; options.registry.GoogleMap = options.Class.extend({ diff --git a/addons/website/static/src/snippets/s_image_gallery/000.js b/addons/website/static/src/snippets/s_image_gallery/000.js index 60837f9942303..2206eb35f01f6 100644 --- a/addons/website/static/src/snippets/s_image_gallery/000.js +++ b/addons/website/static/src/snippets/s_image_gallery/000.js @@ -1,8 +1,8 @@ -/** @odoo-module alias=website.s_image_gallery **/ +/** @odoo-module **/ import { uniqueId } from "@web/core/utils/functions"; -import core from "web.core"; -import publicWidget from "web.public.widget"; +import core from "@web/legacy/js/services/core"; +import publicWidget from "@web/legacy/js/public/public_widget"; var qweb = core.qweb; diff --git a/addons/website/static/src/snippets/s_image_gallery/options.js b/addons/website/static/src/snippets/s_image_gallery/options.js index b116f3a49d540..ff6f2f53256ae 100644 --- a/addons/website/static/src/snippets/s_image_gallery/options.js +++ b/addons/website/static/src/snippets/s_image_gallery/options.js @@ -1,10 +1,10 @@ /** @odoo-module **/ import { MediaDialogWrapper } from "@web_editor/components/media_dialog/media_dialog_wrapper"; -import { ComponentWrapper } from "web.OwlCompatibility"; -import core from "web.core"; -import options from "web_editor.snippets.options"; -import wUtils from "website.utils"; +import { ComponentWrapper } from "@web/legacy/js/owl_compatibility"; +import core from "@web/legacy/js/services/core"; +import options from "@web_editor/js/editor/snippets.options"; +import wUtils from '@website/js/utils'; var _t = core._t; var qweb = core.qweb; @@ -107,7 +107,7 @@ options.registry.GalleryLayout = options.registry.CarouselHandler.extend({ await wUtils.onceAllImagesLoaded(this.$target); } resolve(); - }); + }); }, /** * Allows to change the images layout. @see grid, masonry, nomode, slideshow diff --git a/addons/website/static/src/snippets/s_map/000.js b/addons/website/static/src/snippets/s_map/000.js index df0d84d3f624a..253fd38ff14ff 100644 --- a/addons/website/static/src/snippets/s_map/000.js +++ b/addons/website/static/src/snippets/s_map/000.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import publicWidget from 'web.public.widget'; -import {generateGMapLink, generateGMapIframe} from 'website.utils'; +import publicWidget from '@web/legacy/js/public/public_widget'; +import {generateGMapLink, generateGMapIframe} from '@website/js/utils'; publicWidget.registry.Map = publicWidget.Widget.extend({ selector: '.s_map', diff --git a/addons/website/static/src/snippets/s_map/options.js b/addons/website/static/src/snippets/s_map/options.js index b79f4acabd124..bc85ef361b715 100644 --- a/addons/website/static/src/snippets/s_map/options.js +++ b/addons/website/static/src/snippets/s_map/options.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import {_t} from 'web.core'; -import options from 'web_editor.snippets.options'; -import {generateGMapIframe, generateGMapLink} from 'website.utils'; +import {_t} from "@web/legacy/js/services/core"; +import options from '@web_editor/js/editor/snippets.options'; +import {generateGMapIframe, generateGMapLink} from '@website/js/utils'; options.registry.Map = options.Class.extend({ /** diff --git a/addons/website/static/src/snippets/s_masonry_block/options.js b/addons/website/static/src/snippets/s_masonry_block/options.js index b7db7d8f9c8c2..9c1f329662b93 100644 --- a/addons/website/static/src/snippets/s_masonry_block/options.js +++ b/addons/website/static/src/snippets/s_masonry_block/options.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import options from 'web_editor.snippets.options'; +import options from '@web_editor/js/editor/snippets.options'; options.registry.MasonryLayout = options.registry.SelectTemplate.extend({ /** diff --git a/addons/website/static/src/snippets/s_media_list/options.js b/addons/website/static/src/snippets/s_media_list/options.js index 48f337a0ba933..66030ae3bbf32 100644 --- a/addons/website/static/src/snippets/s_media_list/options.js +++ b/addons/website/static/src/snippets/s_media_list/options.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import options from "web_editor.snippets.options"; +import options from "@web_editor/js/editor/snippets.options"; options.registry.MediaItemLayout = options.Class.extend({ diff --git a/addons/website/static/src/snippets/s_popup/000.js b/addons/website/static/src/snippets/s_popup/000.js index c3013ccced2b9..6e396e1513121 100644 --- a/addons/website/static/src/snippets/s_popup/000.js +++ b/addons/website/static/src/snippets/s_popup/000.js @@ -1,9 +1,9 @@ -/** @odoo-module alias=website.s_popup **/ +/** @odoo-module **/ -import config from "web.config"; -import publicWidget from "web.public.widget"; -import {getCookie, setCookie} from "web.utils.cookies"; -import dom from "web.dom"; +import config from "@web/legacy/js/services/config"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import {getCookie, setCookie} from "@web/legacy/js/core/cookie_utils"; +import dom from "@web/legacy/js/core/dom"; import {throttleForAnimation} from "@web/core/utils/timing"; // TODO In master, export this class too or merge it with PopupWidget diff --git a/addons/website/static/src/snippets/s_popup/options.js b/addons/website/static/src/snippets/s_popup/options.js index a1ab208afa1bf..11b7bf8bffff1 100644 --- a/addons/website/static/src/snippets/s_popup/options.js +++ b/addons/website/static/src/snippets/s_popup/options.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=website.s_popup_options **/ +/** @odoo-module **/ -import options from "web_editor.snippets.options"; +import options from "@web_editor/js/editor/snippets.options"; options.registry.SnippetPopup = options.Class.extend({ /** @@ -39,7 +39,7 @@ options.registry.SnippetPopup = options.Class.extend({ buttonEl: this._requestUserValueWidgets("onclick_opt")[0].el, }, }); - } + } return this._super(...arguments); }, /** diff --git a/addons/website/static/src/snippets/s_process_steps/options.js b/addons/website/static/src/snippets/s_process_steps/options.js index f0576c4110752..0922d24aad381 100644 --- a/addons/website/static/src/snippets/s_process_steps/options.js +++ b/addons/website/static/src/snippets/s_process_steps/options.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import options from 'web_editor.snippets.options'; -import weUtils from 'web_editor.utils'; +import options from '@web_editor/js/editor/snippets.options'; +import weUtils from '@web_editor/js/common/utils'; import {SIZES, MEDIAS_BREAKPOINTS} from '@web/core/ui/ui_service'; options.registry.StepsConnector = options.Class.extend({ diff --git a/addons/website/static/src/snippets/s_product_catalog/options.js b/addons/website/static/src/snippets/s_product_catalog/options.js index 599b0671f2b1d..6b33c919e885c 100644 --- a/addons/website/static/src/snippets/s_product_catalog/options.js +++ b/addons/website/static/src/snippets/s_product_catalog/options.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import core from "web.core"; -import options from "web_editor.snippets.options"; +import core from "@web/legacy/js/services/core"; +import options from "@web_editor/js/editor/snippets.options"; const _t = core._t; diff --git a/addons/website/static/src/snippets/s_progress_bar/options.js b/addons/website/static/src/snippets/s_progress_bar/options.js index b647e2a22ba80..256893ffa14d4 100644 --- a/addons/website/static/src/snippets/s_progress_bar/options.js +++ b/addons/website/static/src/snippets/s_progress_bar/options.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import core from "web.core"; -import utils from "web.utils"; -import options from "web_editor.snippets.options"; +import core from "@web/legacy/js/services/core"; +import utils from "@web/legacy/js/core/utils"; +import options from "@web_editor/js/editor/snippets.options"; const _t = core._t; diff --git a/addons/website/static/src/snippets/s_rating/options.js b/addons/website/static/src/snippets/s_rating/options.js index d6d334c1d5aa3..7d9233af07c7f 100644 --- a/addons/website/static/src/snippets/s_rating/options.js +++ b/addons/website/static/src/snippets/s_rating/options.js @@ -1,9 +1,9 @@ /** @odoo-module **/ -import { ComponentWrapper } from "web.OwlCompatibility"; +import { ComponentWrapper } from "@web/legacy/js/owl_compatibility"; import { MediaDialogWrapper } from "@web_editor/components/media_dialog/media_dialog_wrapper"; -import options from "web_editor.snippets.options"; +import options from "@web_editor/js/editor/snippets.options"; options.registry.Rating = options.Class.extend({ /** diff --git a/addons/website/static/src/snippets/s_searchbar/000.js b/addons/website/static/src/snippets/s_searchbar/000.js index cadc904d72511..1c5635518959c 100644 --- a/addons/website/static/src/snippets/s_searchbar/000.js +++ b/addons/website/static/src/snippets/s_searchbar/000.js @@ -1,10 +1,10 @@ /** @odoo-module **/ -import concurrency from 'web.concurrency'; -import publicWidget from 'web.public.widget'; +import concurrency from '@web/legacy/js/core/concurrency'; +import publicWidget from '@web/legacy/js/public/public_widget'; -import {qweb} from 'web.core'; -import {Markup} from 'web.utils'; +import {qweb} from "@web/legacy/js/services/core"; +import { Markup } from '@web/legacy/js/core/utils'; import { debounce } from '@web/core/utils/timing'; publicWidget.registry.searchBar = publicWidget.Widget.extend({ diff --git a/addons/website/static/src/snippets/s_searchbar/options.js b/addons/website/static/src/snippets/s_searchbar/options.js index 3868525dd02bc..fe0bf46030a1f 100644 --- a/addons/website/static/src/snippets/s_searchbar/options.js +++ b/addons/website/static/src/snippets/s_searchbar/options.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import options from 'web_editor.snippets.options'; +import options from '@web_editor/js/editor/snippets.options'; options.registry.SearchBar = options.Class.extend({ //-------------------------------------------------------------------------- diff --git a/addons/website/static/src/snippets/s_share/000.js b/addons/website/static/src/snippets/s_share/000.js index c3f1a29c8f861..674320219faa4 100644 --- a/addons/website/static/src/snippets/s_share/000.js +++ b/addons/website/static/src/snippets/s_share/000.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import publicWidget from 'web.public.widget'; +import publicWidget from '@web/legacy/js/public/public_widget'; const ShareWidget = publicWidget.Widget.extend({ selector: '.s_share, .oe_share', // oe_share for compatibility diff --git a/addons/website/static/src/snippets/s_showcase/options.js b/addons/website/static/src/snippets/s_showcase/options.js index e164a61371b16..296ad494d2e3e 100644 --- a/addons/website/static/src/snippets/s_showcase/options.js +++ b/addons/website/static/src/snippets/s_showcase/options.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import options from "web_editor.snippets.options"; +import options from "@web_editor/js/editor/snippets.options"; options.registry.Showcase = options.Class.extend({ /** diff --git a/addons/website/static/src/snippets/s_social_media/options.js b/addons/website/static/src/snippets/s_social_media/options.js index 94d2f41ad45e8..6c6f641fa7604 100644 --- a/addons/website/static/src/snippets/s_social_media/options.js +++ b/addons/website/static/src/snippets/s_social_media/options.js @@ -1,9 +1,9 @@ /** @odoo-module **/ -import fonts from 'wysiwyg.fonts'; -import {generateHTMLId} from 'web_editor.utils'; -import options from 'web_editor.snippets.options'; -import {_t} from 'web.core'; +import fonts from '@web_editor/js/wysiwyg/fonts'; +import weUtils from '@web_editor/js/common/utils'; +import options from '@web_editor/js/editor/snippets.options'; +import {_t} from "@web/legacy/js/services/core"; let dbSocialValues; let dbSocialValuesProm; @@ -197,7 +197,7 @@ options.registry.SocialMedia = options.Class.extend({ listPosition++; } return { - id: generateHTMLId(), + id: weUtils.generateHTMLId(), display_name: media ? dbSocialValues[`social_${media}`] : el.getAttribute('href'), placeholder: `https://${encodeURIComponent(media) || 'example'}.com/yourPage`, undeletable: !!media, @@ -215,7 +215,7 @@ options.registry.SocialMedia = options.Class.extend({ const entryNotInDom = this.entriesNotInDom.find(entry => entry.media === media); if (!entryNotInDom) { this.entriesNotInDom.push({ - id: generateHTMLId(), + id: weUtils.generateHTMLId(), display_name: link, placeholder: `https://${encodeURIComponent(media)}.com/yourPage`, undeletable: true, diff --git a/addons/website/static/src/snippets/s_table_of_content/000.js b/addons/website/static/src/snippets/s_table_of_content/000.js index fec0d2d1db0c0..a0745c8705ded 100644 --- a/addons/website/static/src/snippets/s_table_of_content/000.js +++ b/addons/website/static/src/snippets/s_table_of_content/000.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=website.s_table_of_content **/ +/** @odoo-module **/ -import publicWidget from "web.public.widget"; -import {extraMenuUpdateCallbacks} from "website.content.menu"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import {extraMenuUpdateCallbacks} from "@website/js/content/menu"; const TableOfContent = publicWidget.Widget.extend({ selector: 'section .s_table_of_content_navbar_sticky', diff --git a/addons/website/static/src/snippets/s_table_of_content/options.js b/addons/website/static/src/snippets/s_table_of_content/options.js index 86ecd9d10ab8f..727d7bd230616 100644 --- a/addons/website/static/src/snippets/s_table_of_content/options.js +++ b/addons/website/static/src/snippets/s_table_of_content/options.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { uniqueId } from "@web/core/utils/functions"; -import options from "web_editor.snippets.options"; +import options from "@web_editor/js/editor/snippets.options"; options.registry.TableOfContent = options.Class.extend({ /** diff --git a/addons/website/static/src/snippets/s_tabs/options.js b/addons/website/static/src/snippets/s_tabs/options.js index b51c1602fd7b5..a18b9d6530c4e 100644 --- a/addons/website/static/src/snippets/s_tabs/options.js +++ b/addons/website/static/src/snippets/s_tabs/options.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { uniqueId } from "@web/core/utils/functions"; -import options from "web_editor.snippets.options"; +import options from "@web_editor/js/editor/snippets.options"; options.registry.NavTabs = options.registry.MultipleItems.extend({ isTopOption: true, diff --git a/addons/website/static/src/snippets/s_timeline/options.js b/addons/website/static/src/snippets/s_timeline/options.js index 51e92ee31aacf..5f3bd16f8b4f8 100644 --- a/addons/website/static/src/snippets/s_timeline/options.js +++ b/addons/website/static/src/snippets/s_timeline/options.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import options from "web_editor.snippets.options"; +import options from "@web_editor/js/editor/snippets.options"; options.registry.Timeline = options.Class.extend({ displayOverlayOptions: true, diff --git a/addons/website/static/src/snippets/s_website_form/000.js b/addons/website/static/src/snippets/s_website_form/000.js index bc0a190bd83e3..3d1ba043acb86 100644 --- a/addons/website/static/src/snippets/s_website_form/000.js +++ b/addons/website/static/src/snippets/s_website_form/000.js @@ -1,13 +1,13 @@ -/** @odoo-module alias=website.s_website_form **/ - - import core from "web.core"; - import time from "web.time"; - import {ReCaptcha} from "google_recaptcha.ReCaptchaV3"; +/** @odoo-module **/ + + import core from "@web/legacy/js/services/core"; + import time from "@web/legacy/js/core/time"; + import {ReCaptcha} from "@google_recaptcha/js/recaptcha"; import session from "web.session"; - import ajax from "web.ajax"; - import publicWidget from "web.public.widget"; - import dom from "web.dom"; - import concurrency from "web.concurrency"; + import ajax from "@web/legacy/js/core/ajax"; + import publicWidget from "@web/legacy/js/public/public_widget"; + import dom from "@web/legacy/js/core/dom"; + import concurrency from "@web/legacy/js/core/concurrency"; import { sprintf } from "@web/core/utils/strings"; import { debounce } from "@web/core/utils/timing"; @@ -167,7 +167,7 @@ if (name === 'email_to' && fieldEl.value // The following value is the default value that // is set if the form is edited in any way. (see the - // website.form_editor_registry module in editor + // @website/js/form_editor_registry module in editor // assets bundle). // TODO that value should probably never be forced // unless explicitely manipulated by the user or on diff --git a/addons/website/static/src/snippets/s_website_form/options.js b/addons/website/static/src/snippets/s_website_form/options.js index 06668951c3f92..86c3e688cb340 100644 --- a/addons/website/static/src/snippets/s_website_form/options.js +++ b/addons/website/static/src/snippets/s_website_form/options.js @@ -1,12 +1,12 @@ /** @odoo-module **/ -import core from "web.core"; -import FormEditorRegistry from "website.form_editor_registry"; -import options from "web_editor.snippets.options"; -import Dialog from "web.Dialog"; -import dom from "web.dom"; -import {generateHTMLId} from "web_editor.utils"; -import "website.editor.snippets.options"; +import core from "@web/legacy/js/services/core"; +import FormEditorRegistry from "@website/js/form_editor_registry"; +import options from "@web_editor/js/editor/snippets.options"; +import Dialog from "@web/legacy/js/core/dialog"; +import dom from "@web/legacy/js/core/dom"; +import weUtils from "@web_editor/js/common/utils"; +import "@website/js/editor/snippets.options"; import { sprintf } from "@web/core/utils/strings"; import { unique } from "@web/core/utils/arrays"; @@ -161,7 +161,7 @@ const FormEditor = options.Class.extend({ */ _renderField: function (field, resetId = false) { if (!field.id) { - field.id = generateHTMLId(); + field.id = weUtils.generateHTMLId(); } const template = document.createElement('template'); template.innerHTML = qweb.render("website.form_field_" + field.type, {field: field}).trim(); @@ -358,7 +358,7 @@ options.registry.WebsiteFormEditor = FormEditor.extend({ model: 'ir.model', method: 'get_compatible_form_models', }); - + const targetModelName = this.$target[0].dataset.model_name || 'mail.mail'; this.activeForm = this.models.find(m => m.model === targetModelName); currentActionName = this.activeForm.website_form_label; diff --git a/addons/website/static/src/systray_items/website_switcher.js b/addons/website/static/src/systray_items/website_switcher.js index e18a2023fc76d..5ab3cb0047c58 100644 --- a/addons/website/static/src/systray_items/website_switcher.js +++ b/addons/website/static/src/systray_items/website_switcher.js @@ -4,7 +4,7 @@ import { registry } from "@web/core/registry"; import { useService } from "@web/core/utils/hooks"; import { Dropdown } from "@web/core/dropdown/dropdown"; import { DropdownItem } from "@web/core/dropdown/dropdown_item"; -import wUtils from 'website.utils'; +import wUtils from '@website/js/utils'; const { Component } = owl; diff --git a/addons/website/static/tests/tour_utils/focus_blur_snippets_options.js b/addons/website/static/tests/tour_utils/focus_blur_snippets_options.js index f0b9ad3b3545e..722430dc48f34 100644 --- a/addons/website/static/tests/tour_utils/focus_blur_snippets_options.js +++ b/addons/website/static/tests/tour_utils/focus_blur_snippets_options.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import options from "web_editor.snippets.options"; +import options from "@web_editor/js/editor/snippets.options"; const FocusBlur = options.Class.extend({ onFocus() { diff --git a/addons/website/static/tests/tours/automatic_editor.js b/addons/website/static/tests/tours/automatic_editor.js index 48cd2574e96e8..422d010e1a71d 100644 --- a/addons/website/static/tests/tours/automatic_editor.js +++ b/addons/website/static/tests/tours/automatic_editor.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from "website.tour_utils"; +import wTourUtils from "@website/js/tours/tour_utils"; wTourUtils.registerWebsitePreviewTour('automatic_editor_on_new_website', { test: true, diff --git a/addons/website/static/tests/tours/carousel_content_removal.js b/addons/website/static/tests/tours/carousel_content_removal.js index 3168111b0e5ba..73a49111a1ae0 100644 --- a/addons/website/static/tests/tours/carousel_content_removal.js +++ b/addons/website/static/tests/tours/carousel_content_removal.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; wTourUtils.registerWebsitePreviewTour("carousel_content_removal", { test: true, diff --git a/addons/website/static/tests/tours/client_action_iframe_fallback.js b/addons/website/static/tests/tours/client_action_iframe_fallback.js index 58f97e8fa3c59..6be2a1c52a90f 100644 --- a/addons/website/static/tests/tours/client_action_iframe_fallback.js +++ b/addons/website/static/tests/tours/client_action_iframe_fallback.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; wTourUtils.registerWebsitePreviewTour('client_action_iframe_fallback', { test: true, diff --git a/addons/website/static/tests/tours/conditional_visibility.js b/addons/website/static/tests/tours/conditional_visibility.js index 2a70251bdb487..ca9c4872f2ea5 100644 --- a/addons/website/static/tests/tours/conditional_visibility.js +++ b/addons/website/static/tests/tours/conditional_visibility.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; const snippets = [ { diff --git a/addons/website/static/tests/tours/default_shape_gets_palette_colors.js b/addons/website/static/tests/tours/default_shape_gets_palette_colors.js index 4ac3ef21cebd7..3fa728ccf60aa 100644 --- a/addons/website/static/tests/tours/default_shape_gets_palette_colors.js +++ b/addons/website/static/tests/tours/default_shape_gets_palette_colors.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from "website.tour_utils"; +import wTourUtils from "@website/js/tours/tour_utils"; wTourUtils.registerWebsitePreviewTour("default_shape_gets_palette_colors", { test: true, diff --git a/addons/website/static/tests/tours/edit_link_popover.js b/addons/website/static/tests/tours/edit_link_popover.js index 1df82f315c0a1..9a9ca456a4922 100644 --- a/addons/website/static/tests/tours/edit_link_popover.js +++ b/addons/website/static/tests/tours/edit_link_popover.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from "website.tour_utils"; +import wTourUtils from "@website/js/tours/tour_utils"; import { browser } from "@web/core/browser/browser"; import { patch } from "@web/core/utils/patch"; diff --git a/addons/website/static/tests/tours/edit_megamenu.js b/addons/website/static/tests/tours/edit_megamenu.js index 9addcbb80c96f..fe6cca3739ea2 100644 --- a/addons/website/static/tests/tours/edit_megamenu.js +++ b/addons/website/static/tests/tours/edit_megamenu.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from "website.tour_utils"; +import wTourUtils from "@website/js/tours/tour_utils"; const toggleMegaMenu = (stepOptions) => Object.assign({}, { content: "Toggles the mega menu.", diff --git a/addons/website/static/tests/tours/edit_menus.js b/addons/website/static/tests/tours/edit_menus.js index 4986649a6e2af..ee6c3a2c4fa62 100644 --- a/addons/website/static/tests/tours/edit_menus.js +++ b/addons/website/static/tests/tours/edit_menus.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; wTourUtils.registerWebsitePreviewTour('edit_menus', { test: true, diff --git a/addons/website/static/tests/tours/edit_translated_page.js b/addons/website/static/tests/tours/edit_translated_page.js index 6ff2576c9c7e9..05e03d400dc08 100644 --- a/addons/website/static/tests/tours/edit_translated_page.js +++ b/addons/website/static/tests/tours/edit_translated_page.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { registry } from "@web/core/registry"; -import wTourUtils from "website.tour_utils"; +import wTourUtils from "@website/js/tours/tour_utils"; registry.category("web_tour.tours").add('edit_translated_page_redirect', { test: true, diff --git a/addons/website/static/tests/tours/focus_blur_snippets.js b/addons/website/static/tests/tours/focus_blur_snippets.js index 3323cb9c32f4b..fc1c536b64ac7 100644 --- a/addons/website/static/tests/tours/focus_blur_snippets.js +++ b/addons/website/static/tests/tours/focus_blur_snippets.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; const blockIDToData = { parent: { diff --git a/addons/website/static/tests/tours/gray_color_palette.js b/addons/website/static/tests/tours/gray_color_palette.js index a32d2f5fc0ace..bf0baaee491bc 100644 --- a/addons/website/static/tests/tours/gray_color_palette.js +++ b/addons/website/static/tests/tours/gray_color_palette.js @@ -1,5 +1,5 @@ /** @odoo-module **/ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; function waitForCSSReload() { return [ diff --git a/addons/website/static/tests/tours/grid_layout.js b/addons/website/static/tests/tours/grid_layout.js index 3f840cb73f51c..e524f262e8ff6 100644 --- a/addons/website/static/tests/tours/grid_layout.js +++ b/addons/website/static/tests/tours/grid_layout.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; wTourUtils.registerWebsitePreviewTour('website_replace_grid_image', { test: true, diff --git a/addons/website/static/tests/tours/hide_chat_window_on_preview.js b/addons/website/static/tests/tours/hide_chat_window_on_preview.js index aa90b0e39260f..e9e765df4fd88 100644 --- a/addons/website/static/tests/tours/hide_chat_window_on_preview.js +++ b/addons/website/static/tests/tours/hide_chat_window_on_preview.js @@ -2,7 +2,7 @@ import { registry } from "@web/core/registry"; -import wTourUtils from "website.tour_utils"; +import wTourUtils from "@website/js/tours/tour_utils"; registry.category("web_tour.tours").add("test_hide_chat_window_on_preview", { test: true, diff --git a/addons/website/static/tests/tours/homepage_edit_discard.js b/addons/website/static/tests/tours/homepage_edit_discard.js index 995efb5ea50a8..01c79af774c30 100644 --- a/addons/website/static/tests/tours/homepage_edit_discard.js +++ b/addons/website/static/tests/tours/homepage_edit_discard.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from "website.tour_utils"; +import wTourUtils from "@website/js/tours/tour_utils"; wTourUtils.registerWebsitePreviewTour('homepage_edit_discard', { test: true, diff --git a/addons/website/static/tests/tours/html_editor.js b/addons/website/static/tests/tours/html_editor.js index 430c0ce158e73..98659d66aa6af 100644 --- a/addons/website/static/tests/tours/html_editor.js +++ b/addons/website/static/tests/tours/html_editor.js @@ -1,7 +1,7 @@ /** @odoo-module**/ /* global ace */ -import wTourUtils from "website.tour_utils"; +import wTourUtils from "@website/js/tours/tour_utils"; const adminCssModif = '#wrap {display: none;}'; const demoCssModif = '// demo_edition'; diff --git a/addons/website/static/tests/tours/link_tools.js b/addons/website/static/tests/tours/link_tools.js index b2d731ca26a38..638f0b2f24e38 100644 --- a/addons/website/static/tests/tours/link_tools.js +++ b/addons/website/static/tests/tours/link_tools.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; const clickOnImgStep = { content: "Click somewhere else to save.", diff --git a/addons/website/static/tests/tours/media_dialog.js b/addons/website/static/tests/tours/media_dialog.js index e3c837483eddc..1481fca72208d 100644 --- a/addons/website/static/tests/tours/media_dialog.js +++ b/addons/website/static/tests/tours/media_dialog.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; wTourUtils.registerWebsitePreviewTour("website_media_dialog_undraw", { test: true, diff --git a/addons/website/static/tests/tours/multi_edition.js b/addons/website/static/tests/tours/multi_edition.js index bfa5472e4a86b..ec2c8bcf38c78 100644 --- a/addons/website/static/tests/tours/multi_edition.js +++ b/addons/website/static/tests/tours/multi_edition.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; wTourUtils.registerWebsitePreviewTour('website_multi_edition', { test: true, diff --git a/addons/website/static/tests/tours/page_manager.js b/addons/website/static/tests/tours/page_manager.js index 9deceb8fd239a..ccf51ad8def71 100644 --- a/addons/website/static/tests/tours/page_manager.js +++ b/addons/website/static/tests/tours/page_manager.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; // TODO: This part should be moved in a QUnit test const checkKanbanGroupBy = [{ diff --git a/addons/website/static/tests/tours/parallax.js b/addons/website/static/tests/tours/parallax.js index b8a29453979f4..caf5cc8417c51 100644 --- a/addons/website/static/tests/tours/parallax.js +++ b/addons/website/static/tests/tours/parallax.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from "website.tour_utils"; +import wTourUtils from "@website/js/tours/tour_utils"; const coverSnippet = {id: "s_cover", name: "Cover"}; diff --git a/addons/website/static/tests/tours/public_user_editor_dep_widget.js b/addons/website/static/tests/tours/public_user_editor_dep_widget.js index a92e7320b00ff..f46b23609f011 100644 --- a/addons/website/static/tests/tours/public_user_editor_dep_widget.js +++ b/addons/website/static/tests/tours/public_user_editor_dep_widget.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import publicWidget from "web.public.widget"; +import publicWidget from "@web/legacy/js/public/public_widget"; import { loadWysiwygFromTextarea } from "@web_editor/js/frontend/loadWysiwygFromTextarea"; publicWidget.registry['public_user_editor_test'] = publicWidget.Widget.extend({ diff --git a/addons/website/static/tests/tours/restricted_editor.js b/addons/website/static/tests/tours/restricted_editor.js index 8c65497956ccf..7000ffc18155c 100644 --- a/addons/website/static/tests/tours/restricted_editor.js +++ b/addons/website/static/tests/tours/restricted_editor.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from "website.tour_utils"; +import wTourUtils from "@website/js/tours/tour_utils"; wTourUtils.registerWebsitePreviewTour("restricted_editor", { test: true, diff --git a/addons/website/static/tests/tours/rte.js b/addons/website/static/tests/tours/rte.js index 0e993705b344a..46c5ee4ec3470 100644 --- a/addons/website/static/tests/tours/rte.js +++ b/addons/website/static/tests/tours/rte.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import session from "web.session"; -import wTourUtils from "website.tour_utils"; +import wTourUtils from "@website/js/tours/tour_utils"; import { Wysiwyg } from "@web_editor/js/wysiwyg/wysiwyg"; var domReady = new Promise(function (resolve) { diff --git a/addons/website/static/tests/tours/snippet_background_edition.js b/addons/website/static/tests/tours/snippet_background_edition.js index 98e65077088a4..9f7fc271a6647 100644 --- a/addons/website/static/tests/tours/snippet_background_edition.js +++ b/addons/website/static/tests/tours/snippet_background_edition.js @@ -1,7 +1,7 @@ /** @odoo-module */ -import weUtils from 'web_editor.utils'; -import wTourUtils from 'website.tour_utils'; +import weUtils from '@web_editor/js/common/utils'; +import wTourUtils from '@website/js/tours/tour_utils'; const snippets = [ { diff --git a/addons/website/static/tests/tours/snippet_cache_across_websites.js b/addons/website/static/tests/tours/snippet_cache_across_websites.js index 15e11f15ca937..b21a9f8c182f9 100644 --- a/addons/website/static/tests/tours/snippet_cache_across_websites.js +++ b/addons/website/static/tests/tours/snippet_cache_across_websites.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; wTourUtils.registerWebsitePreviewTour('snippet_cache_across_websites', { edition: true, diff --git a/addons/website/static/tests/tours/snippet_countdown.js b/addons/website/static/tests/tours/snippet_countdown.js index 3dd7ccd781d81..5d46e43e4850a 100644 --- a/addons/website/static/tests/tours/snippet_countdown.js +++ b/addons/website/static/tests/tours/snippet_countdown.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; wTourUtils.registerWebsitePreviewTour('snippet_countdown', { test: true, diff --git a/addons/website/static/tests/tours/snippet_editor_panel_options.js b/addons/website/static/tests/tours/snippet_editor_panel_options.js index e2474361fe31b..b9eafce50df7b 100644 --- a/addons/website/static/tests/tours/snippet_editor_panel_options.js +++ b/addons/website/static/tests/tours/snippet_editor_panel_options.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; wTourUtils.registerWebsitePreviewTour('snippet_editor_panel_options', { test: true, diff --git a/addons/website/static/tests/tours/snippet_empty_parent_autoremove.js b/addons/website/static/tests/tours/snippet_empty_parent_autoremove.js index 29343227041ff..7cb0b964538b8 100644 --- a/addons/website/static/tests/tours/snippet_empty_parent_autoremove.js +++ b/addons/website/static/tests/tours/snippet_empty_parent_autoremove.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from "website.tour_utils"; +import wTourUtils from "@website/js/tours/tour_utils"; function removeSelectedBlock() { return { diff --git a/addons/website/static/tests/tours/snippet_image_gallery.js b/addons/website/static/tests/tours/snippet_image_gallery.js index 42f6b5c071b4f..e4e604dc495db 100644 --- a/addons/website/static/tests/tours/snippet_image_gallery.js +++ b/addons/website/static/tests/tours/snippet_image_gallery.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; wTourUtils.registerWebsitePreviewTour('snippet_image_gallery', { test: true, diff --git a/addons/website/static/tests/tours/snippet_image_quality.js b/addons/website/static/tests/tours/snippet_image_quality.js index 4f36c7e66e4f8..55b115693b69c 100644 --- a/addons/website/static/tests/tours/snippet_image_quality.js +++ b/addons/website/static/tests/tours/snippet_image_quality.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from "@website/js/tours/tour_utils"; wTourUtils.registerWebsitePreviewTour('website_image_quality', { test: true, diff --git a/addons/website/static/tests/tours/snippet_images_wall.js b/addons/website/static/tests/tours/snippet_images_wall.js index a36766fc0cbeb..d361e4b34aea2 100644 --- a/addons/website/static/tests/tours/snippet_images_wall.js +++ b/addons/website/static/tests/tours/snippet_images_wall.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from "website.tour_utils"; +import wTourUtils from "@website/js/tours/tour_utils"; const selectSignImageStep = { content: "Click on sign image", diff --git a/addons/website/static/tests/tours/snippet_popup_add_remove.js b/addons/website/static/tests/tours/snippet_popup_add_remove.js index 2d16745a8afeb..f81bf06fe4642 100644 --- a/addons/website/static/tests/tours/snippet_popup_add_remove.js +++ b/addons/website/static/tests/tours/snippet_popup_add_remove.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; wTourUtils.registerWebsitePreviewTour('snippet_popup_add_remove', { test: true, diff --git a/addons/website/static/tests/tours/snippet_popup_and_animations.js b/addons/website/static/tests/tours/snippet_popup_and_animations.js index 6c99fed43454a..d09e1f3d1dc31 100644 --- a/addons/website/static/tests/tours/snippet_popup_and_animations.js +++ b/addons/website/static/tests/tours/snippet_popup_and_animations.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import wTourUtils from "website.tour_utils"; +import wTourUtils from "@website/js/tours/tour_utils"; const snippets = [ { diff --git a/addons/website/static/tests/tours/snippet_popup_and_scrollbar.js b/addons/website/static/tests/tours/snippet_popup_and_scrollbar.js index b81a46935927f..14100b71cb7d4 100644 --- a/addons/website/static/tests/tours/snippet_popup_and_scrollbar.js +++ b/addons/website/static/tests/tours/snippet_popup_and_scrollbar.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import wTourUtils from "website.tour_utils"; +import wTourUtils from "@website/js/tours/tour_utils"; const snippets = [ { diff --git a/addons/website/static/tests/tours/snippet_popup_display_on_click.js b/addons/website/static/tests/tours/snippet_popup_display_on_click.js index 81daa6c7a768b..5d82aa5a78457 100644 --- a/addons/website/static/tests/tours/snippet_popup_display_on_click.js +++ b/addons/website/static/tests/tours/snippet_popup_display_on_click.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import wTourUtils from "website.tour_utils"; +import wTourUtils from "@website/js/tours/tour_utils"; wTourUtils.registerWebsitePreviewTour("snippet_popup_display_on_click", { test: true, diff --git a/addons/website/static/tests/tours/snippet_social_media.js b/addons/website/static/tests/tours/snippet_social_media.js index b6842b8e92ab3..ad78c35775844 100644 --- a/addons/website/static/tests/tours/snippet_social_media.js +++ b/addons/website/static/tests/tours/snippet_social_media.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; // TODO: Remove following steps once fix of task-3212519 is done. // Those steps are preventing a race condition to happen in the meantime: when diff --git a/addons/website/static/tests/tours/snippet_table_of_content.js b/addons/website/static/tests/tours/snippet_table_of_content.js index 8c82413c99960..e9c8bf2cdc548 100644 --- a/addons/website/static/tests/tours/snippet_table_of_content.js +++ b/addons/website/static/tests/tours/snippet_table_of_content.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; const scrollToHeading = function (position) { return { diff --git a/addons/website/static/tests/tours/snippet_translation.js b/addons/website/static/tests/tours/snippet_translation.js index e7798d0390315..af373f80dca57 100644 --- a/addons/website/static/tests/tours/snippet_translation.js +++ b/addons/website/static/tests/tours/snippet_translation.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; wTourUtils.registerWebsitePreviewTour('snippet_translation', { url: '/', diff --git a/addons/website/static/tests/tours/snippet_version.js b/addons/website/static/tests/tours/snippet_version.js index 885cf5435a54a..46486e9d85a15 100644 --- a/addons/website/static/tests/tours/snippet_version.js +++ b/addons/website/static/tests/tours/snippet_version.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from "website.tour_utils"; +import wTourUtils from "@website/js/tours/tour_utils"; wTourUtils.registerWebsitePreviewTour("snippet_version", { edition: true, diff --git a/addons/website/static/tests/tours/snippets_all_drag_and_drop.js b/addons/website/static/tests/tours/snippets_all_drag_and_drop.js index 50ded941a10b6..c291ab00c20e5 100644 --- a/addons/website/static/tests/tours/snippets_all_drag_and_drop.js +++ b/addons/website/static/tests/tours/snippets_all_drag_and_drop.js @@ -1,8 +1,8 @@ /** @odoo-module **/ import { WysiwygAdapterComponent } from "@website/components/wysiwyg_adapter/wysiwyg_adapter"; -import websiteTourUtils from "website.tour_utils"; -import { patch, unpatch } from "web.utils"; +import websiteTourUtils from "@website/js/tours/tour_utils"; +import { patch, unpatch } from '@web/legacy/js/core/utils'; const patchWysiwygAdapter = () => patch(WysiwygAdapterComponent.prototype, 'snippets_all_drag_and_drop.wysiwyg_adapter', { _trigger_up(ev) { diff --git a/addons/website/static/tests/tours/specific_website_editor.js b/addons/website/static/tests/tours/specific_website_editor.js index 516d4a6472e6c..10c2d3e28ea82 100644 --- a/addons/website/static/tests/tours/specific_website_editor.js +++ b/addons/website/static/tests/tours/specific_website_editor.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { registry } from "@web/core/registry"; -import wTourUtils from "website.tour_utils"; +import wTourUtils from "@website/js/tours/tour_utils"; wTourUtils.registerWebsitePreviewTour("generic_website_editor", { test: true, diff --git a/addons/website/static/tests/tours/start_cloned_snippet.js b/addons/website/static/tests/tours/start_cloned_snippet.js index 999e595541425..40153c169eb4b 100644 --- a/addons/website/static/tests/tours/start_cloned_snippet.js +++ b/addons/website/static/tests/tours/start_cloned_snippet.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; const countdownSnippet = { name: 'Countdown', diff --git a/addons/website/static/tests/tours/text_animations.js b/addons/website/static/tests/tours/text_animations.js index 3b25ef2b448ec..64ec6fac578cc 100644 --- a/addons/website/static/tests/tours/text_animations.js +++ b/addons/website/static/tests/tours/text_animations.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import wTourUtils from "website.tour_utils"; +import wTourUtils from "@website/js/tours/tour_utils"; wTourUtils.registerWebsitePreviewTour("text_animations", { test: true, diff --git a/addons/website/static/tests/tours/translate_menu_name.js b/addons/website/static/tests/tours/translate_menu_name.js index 997c703b1053f..ce5bb8034f74b 100644 --- a/addons/website/static/tests/tours/translate_menu_name.js +++ b/addons/website/static/tests/tours/translate_menu_name.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; wTourUtils.registerWebsitePreviewTour('translate_menu_name', { url: '/pa_GB', diff --git a/addons/website/static/tests/tours/website_click_tests.js b/addons/website/static/tests/tours/website_click_tests.js index aa5a495cf3732..808a90c352210 100644 --- a/addons/website/static/tests/tours/website_click_tests.js +++ b/addons/website/static/tests/tours/website_click_tests.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; const cover = { id: 's_cover', diff --git a/addons/website/static/tests/tours/website_form_editor.js b/addons/website/static/tests/tours/website_form_editor.js index 6fd8e589d343d..f1ff68fbf92c3 100644 --- a/addons/website/static/tests/tours/website_form_editor.js +++ b/addons/website/static/tests/tours/website_form_editor.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=website.tour.form_editor **/ +/** @odoo-module **/ - import wTourUtils from "website.tour_utils"; + import wTourUtils from "@website/js/tours/tour_utils"; // Visibility possible values: const VISIBLE = 'Always Visible'; diff --git a/addons/website/static/tests/tours/website_form_editor_frontend.js b/addons/website/static/tests/tours/website_form_editor_frontend.js index b31c9d59630ba..7af3742da3c9d 100644 --- a/addons/website/static/tests/tours/website_form_editor_frontend.js +++ b/addons/website/static/tests/tours/website_form_editor_frontend.js @@ -1,6 +1,6 @@ /** @odoo-module **/ import { registry } from "@web/core/registry"; -import rpc from 'web.rpc'; +import rpc from '@web/legacy/js/core/rpc'; registry.category("web_tour.tours").add("website_form_editor_tour_submit", { test: true, diff --git a/addons/website/static/tests/tours/website_page_options.js b/addons/website/static/tests/tours/website_page_options.js index 7412d75606090..66b5465dfcd0f 100644 --- a/addons/website/static/tests/tours/website_page_options.js +++ b/addons/website/static/tests/tours/website_page_options.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; wTourUtils.registerWebsitePreviewTour('website_page_options', { test: true, diff --git a/addons/website/static/tests/tours/website_snippets_menu_tabs.js b/addons/website/static/tests/tours/website_snippets_menu_tabs.js index ad4234f178dcb..773cf96d86339 100644 --- a/addons/website/static/tests/tours/website_snippets_menu_tabs.js +++ b/addons/website/static/tests/tours/website_snippets_menu_tabs.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; wTourUtils.registerWebsitePreviewTour("website_snippets_menu_tabs", { test: true, diff --git a/addons/website/static/tests/tours/website_style_edition.js b/addons/website/static/tests/tours/website_style_edition.js index 41ff90861399d..048317134f03c 100644 --- a/addons/website/static/tests/tours/website_style_edition.js +++ b/addons/website/static/tests/tours/website_style_edition.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from "website.tour_utils"; +import wTourUtils from "@website/js/tours/tour_utils"; const TARGET_FONT_SIZE = 30; diff --git a/addons/website/static/tests/tours/website_text_edition.js b/addons/website/static/tests/tours/website_text_edition.js index 31e7a71ae6d6d..f41bf258aaade 100644 --- a/addons/website/static/tests/tours/website_text_edition.js +++ b/addons/website/static/tests/tours/website_text_edition.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; const WEBSITE_MAIN_COLOR = '#ABCDEF'; diff --git a/addons/website_blog/static/src/js/contentshare.js b/addons/website_blog/static/src/js/contentshare.js index 86e0d4087ab38..f14c7d9df11e5 100644 --- a/addons/website_blog/static/src/js/contentshare.js +++ b/addons/website_blog/static/src/js/contentshare.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { sprintf } from "@web/core/utils/strings"; -import dom from "web.dom"; +import dom from "@web/legacy/js/core/dom"; $.fn.share = function (options) { var option = $.extend($.fn.share.defaults, options); diff --git a/addons/website_blog/static/src/js/options.js b/addons/website_blog/static/src/js/options.js index 4615c56549eb8..a246a39083efc 100644 --- a/addons/website_blog/static/src/js/options.js +++ b/addons/website_blog/static/src/js/options.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import {_t} from "web.core"; -import options from "web_editor.snippets.options"; -import "website.editor.snippets.options"; +import {_t} from "@web/legacy/js/services/core"; +import options from "@web_editor/js/editor/snippets.options"; +import "@website/js/editor/snippets.options"; import { uniqueId } from "@web/core/utils/functions"; const NEW_TAG_PREFIX = 'new-blog-tag-'; diff --git a/addons/website_blog/static/src/js/systray_items/new_content.js b/addons/website_blog/static/src/js/systray_items/new_content.js index 2e36b7f436734..80b7daa020ad4 100644 --- a/addons/website_blog/static/src/js/systray_items/new_content.js +++ b/addons/website_blog/static/src/js/systray_items/new_content.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { NewContentModal, MODULE_STATUS } from '@website/systray_items/new_content'; -import { patch } from 'web.utils'; +import { patch } from '@web/legacy/js/core/utils'; patch(NewContentModal.prototype, 'website_blog_new_content', { setup() { diff --git a/addons/website_blog/static/src/js/tours/website_blog.js b/addons/website_blog/static/src/js/tours/website_blog.js index fda34fabce381..6c05404d9f181 100644 --- a/addons/website_blog/static/src/js/tours/website_blog.js +++ b/addons/website_blog/static/src/js/tours/website_blog.js @@ -1,9 +1,9 @@ /** @odoo-module **/ - - import {_t} from "web.core"; - import "web.legacy_tranlations_loaded"; - import {Markup} from "web.utils"; - import wTourUtils from "website.tour_utils"; + + import {_t} from "@web/legacy/js/services/core"; + import "@web/legacy/translations_loaded"; + import { Markup } from "@web/legacy/js/core/utils"; + import wTourUtils from "@website/js/tours/tour_utils"; wTourUtils.registerWebsitePreviewTour("blog", { url: "/", diff --git a/addons/website_blog/static/src/js/website_blog.js b/addons/website_blog/static/src/js/website_blog.js index beec7a5859133..b1d0e283c6836 100644 --- a/addons/website_blog/static/src/js/website_blog.js +++ b/addons/website_blog/static/src/js/website_blog.js @@ -1,9 +1,9 @@ /** @odoo-module **/ import { sprintf } from "@web/core/utils/strings"; -import core from "web.core"; -import dom from "web.dom"; -import publicWidget from "web.public.widget"; +import core from "@web/legacy/js/services/core"; +import dom from "@web/legacy/js/core/dom"; +import publicWidget from "@web/legacy/js/public/public_widget"; publicWidget.registry.websiteBlog = publicWidget.Widget.extend({ selector: '.website_blog', diff --git a/addons/website_blog/static/src/js/wysiwyg.js b/addons/website_blog/static/src/js/wysiwyg.js index 40101d07f1cf2..81541282aee9f 100644 --- a/addons/website_blog/static/src/js/wysiwyg.js +++ b/addons/website_blog/static/src/js/wysiwyg.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { WysiwygAdapterComponent } from '@website/components/wysiwyg_adapter/wysiwyg_adapter'; -import "website.editor.snippets.options"; +import "@website/js/editor/snippets.options"; import { patch } from "@web/core/utils/patch"; patch(WysiwygAdapterComponent.prototype, 'website_blog/static/src/js/wysiwyg.js', { diff --git a/addons/website_blog/static/src/snippets/s_blog_posts/000.js b/addons/website_blog/static/src/snippets/s_blog_posts/000.js index 4a740bb5dcf88..b88fd75539d5d 100644 --- a/addons/website_blog/static/src/snippets/s_blog_posts/000.js +++ b/addons/website_blog/static/src/snippets/s_blog_posts/000.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=website_blog.s_blog_posts_frontend **/ +/** @odoo-module **/ -import publicWidget from "web.public.widget"; -import DynamicSnippet from "website.s_dynamic_snippet"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import DynamicSnippet from "@website/snippets/s_dynamic_snippet/000"; const DynamicSnippetBlogPosts = DynamicSnippet.extend({ selector: '.s_dynamic_snippet_blog_posts', diff --git a/addons/website_blog/static/src/snippets/s_blog_posts/options.js b/addons/website_blog/static/src/snippets/s_blog_posts/options.js index c50fb836175d6..85a941585211f 100644 --- a/addons/website_blog/static/src/snippets/s_blog_posts/options.js +++ b/addons/website_blog/static/src/snippets/s_blog_posts/options.js @@ -1,9 +1,9 @@ -/** @odoo-module alias=website_blog.s_blog_posts_options **/ +/** @odoo-module **/ -import options from "web_editor.snippets.options"; -import dynamicSnippetOptions from "website.s_dynamic_snippet_options"; +import options from "@web_editor/js/editor/snippets.options"; +import dynamicSnippetOptions from "@website/snippets/s_dynamic_snippet/options"; -import wUtils from "website.utils"; +import wUtils from "@website/js/utils"; const dynamicSnippetBlogPostsOptions = dynamicSnippetOptions.extend({ /** diff --git a/addons/website_blog/static/tests/tours/blog_tags_tour.js b/addons/website_blog/static/tests/tours/blog_tags_tour.js index ce7bece7ba1bf..52c6b922e81a4 100644 --- a/addons/website_blog/static/tests/tours/blog_tags_tour.js +++ b/addons/website_blog/static/tests/tours/blog_tags_tour.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; /** diff --git a/addons/website_cf_turnstile/static/src/js/turnstile.js b/addons/website_cf_turnstile/static/src/js/turnstile.js index 7d276e55fb533..596d8d2a6c5d2 100644 --- a/addons/website_cf_turnstile/static/src/js/turnstile.js +++ b/addons/website_cf_turnstile/static/src/js/turnstile.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import "website.s_website_form"; // force deps -import publicWidget from 'web.public.widget'; +import "@website/snippets/s_website_form/000"; // force deps +import publicWidget from '@web/legacy/js/public/public_widget'; import { session } from "@web/session"; publicWidget.registry.s_website_form.include({ diff --git a/addons/website_crm/static/src/js/website_crm_editor.js b/addons/website_crm/static/src/js/website_crm_editor.js index 00c46f2dbddc4..d507947cd7cd5 100644 --- a/addons/website_crm/static/src/js/website_crm_editor.js +++ b/addons/website_crm/static/src/js/website_crm_editor.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import core from "web.core"; -import FormEditorRegistry from "website.form_editor_registry"; +import core from "@web/legacy/js/services/core"; +import FormEditorRegistry from "@website/js/form_editor_registry"; var _t = core._t; diff --git a/addons/website_crm/static/tests/tours/website_crm.js b/addons/website_crm/static/tests/tours/website_crm.js index bd4221c888698..ac6ea7e0f5244 100644 --- a/addons/website_crm/static/tests/tours/website_crm.js +++ b/addons/website_crm/static/tests/tours/website_crm.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=website_crm.tour **/ - +/** @odoo-module **/ + import { registry } from "@web/core/registry"; - import wTourUtils from "website.tour_utils"; + import wTourUtils from "@website/js/tours/tour_utils"; wTourUtils.registerWebsitePreviewTour('website_crm_pre_tour', { test: true, diff --git a/addons/website_crm_partner_assign/static/src/js/crm_partner_assign.js b/addons/website_crm_partner_assign/static/src/js/crm_partner_assign.js index 504256cac55b4..084c3a44fda9d 100644 --- a/addons/website_crm_partner_assign/static/src/js/crm_partner_assign.js +++ b/addons/website_crm_partner_assign/static/src/js/crm_partner_assign.js @@ -1,9 +1,9 @@ /** @odoo-module **/ import { sprintf } from "@web/core/utils/strings"; -import {_t} from "web.core"; -import publicWidget from "web.public.widget"; -import time from "web.time"; +import {_t} from "@web/legacy/js/services/core"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import time from "@web/legacy/js/core/time"; publicWidget.registry.crmPartnerAssign = publicWidget.Widget.extend({ selector: '#wrapwrap:has(.interested_partner_assign_form, .desinterested_partner_assign_form, .opp-stage-button, .new_opp_form)', diff --git a/addons/website_event/static/src/js/display_timer_widget.js b/addons/website_event/static/src/js/display_timer_widget.js index 2f8fde6ff7db0..5585ba2448a33 100644 --- a/addons/website_event/static/src/js/display_timer_widget.js +++ b/addons/website_event/static/src/js/display_timer_widget.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=website_event.display_timer_widget **/ +/** @odoo-module **/ -import publicWidget from "web.public.widget"; +import publicWidget from "@web/legacy/js/public/public_widget"; publicWidget.registry.displayTimerWidget = publicWidget.Widget.extend({ selector: '.o_display_timer', diff --git a/addons/website_event/static/src/js/register_toaster_widget.js b/addons/website_event/static/src/js/register_toaster_widget.js index 4fedb199f9cc1..b9f77a7c48c27 100644 --- a/addons/website_event/static/src/js/register_toaster_widget.js +++ b/addons/website_event/static/src/js/register_toaster_widget.js @@ -1,9 +1,9 @@ -/** @odoo-module alias=website_event.register_toaster_widget **/ +/** @odoo-module **/ -import core from "web.core"; -import {Markup} from "web.utils"; +import core from "@web/legacy/js/services/core"; +import { Markup } from "@web/legacy/js/core/utils"; let _t = core._t; -import publicWidget from "web.public.widget"; +import publicWidget from "@web/legacy/js/public/public_widget"; publicWidget.registry.RegisterToasterWidget = publicWidget.Widget.extend({ selector: '.o_wevent_register_toaster', diff --git a/addons/website_event/static/src/js/systray_items/new_content.js b/addons/website_event/static/src/js/systray_items/new_content.js index 560d237e6adf0..e2951f44666d1 100644 --- a/addons/website_event/static/src/js/systray_items/new_content.js +++ b/addons/website_event/static/src/js/systray_items/new_content.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { NewContentModal, MODULE_STATUS } from '@website/systray_items/new_content'; -import { patch } from 'web.utils'; +import { patch } from '@web/legacy/js/core/utils'; patch(NewContentModal.prototype, 'website_event_new_content', { setup() { diff --git a/addons/website_event/static/src/js/tours/event_tour.js b/addons/website_event/static/src/js/tours/event_tour.js index 83722593e519d..4e01d84db68f7 100644 --- a/addons/website_event/static/src/js/tours/event_tour.js +++ b/addons/website_event/static/src/js/tours/event_tour.js @@ -1,10 +1,10 @@ -/** @odoo-module alias=website_event.event_steps **/ +/** @odoo-module **/ -import {_t} from "web.core"; -import "web.legacy_tranlations_loaded"; -import {Markup} from "web.utils"; +import {_t} from "@web/legacy/js/services/core"; +import "@web/legacy/translations_loaded"; +import { Markup } from "@web/legacy/js/core/utils"; -import EventAdditionalTourSteps from "event.event_steps"; +import EventAdditionalTourSteps from "@event/js/tours/event_steps"; EventAdditionalTourSteps.include({ diff --git a/addons/website_event/static/src/js/website_event.js b/addons/website_event/static/src/js/website_event.js index 99314a1638046..4e482eee3b5ed 100644 --- a/addons/website_event/static/src/js/website_event.js +++ b/addons/website_event/static/src/js/website_event.js @@ -1,8 +1,8 @@ -/** @odoo-module alias=website_event.website_event **/ +/** @odoo-module **/ -import ajax from "web.ajax"; -import core from "web.core"; -import publicWidget from "web.public.widget"; +import ajax from "@web/legacy/js/core/ajax"; +import core from "@web/legacy/js/services/core"; +import publicWidget from "@web/legacy/js/public/public_widget"; var _t = core._t; diff --git a/addons/website_event/static/src/js/website_event_ticket_details.js b/addons/website_event/static/src/js/website_event_ticket_details.js index c8a5327a8504a..b001141c1b902 100644 --- a/addons/website_event/static/src/js/website_event_ticket_details.js +++ b/addons/website_event/static/src/js/website_event_ticket_details.js @@ -1,5 +1,5 @@ -/** @odoo-module alias=website_event.ticket_details **/ - import publicWidget from "web.public.widget"; +/** @odoo-module **/ + import publicWidget from "@web/legacy/js/public/public_widget"; publicWidget.registry.ticketDetailsWidget = publicWidget.Widget.extend({ selector: '.o_wevent_js_ticket_details', diff --git a/addons/website_event/static/src/snippets/options.js b/addons/website_event/static/src/snippets/options.js index eb2fd86189d3e..6150eb51970f1 100644 --- a/addons/website_event/static/src/snippets/options.js +++ b/addons/website_event/static/src/snippets/options.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import options from 'web_editor.snippets.options'; +import options from '@web_editor/js/editor/snippets.options'; options.registry.WebsiteEvent = options.Class.extend({ diff --git a/addons/website_event/static/src/snippets/s_events/000.js b/addons/website_event/static/src/snippets/s_events/000.js index c1bc5fb1b39fe..ff2fff100767b 100644 --- a/addons/website_event/static/src/snippets/s_events/000.js +++ b/addons/website_event/static/src/snippets/s_events/000.js @@ -1,8 +1,8 @@ /** @odoo-module **/ import { groupBy } from '@web/core/utils/arrays'; -import publicWidget from 'web.public.widget'; -import DynamicSnippet from 'website.s_dynamic_snippet'; +import publicWidget from '@web/legacy/js/public/public_widget'; +import DynamicSnippet from '@website/snippets/s_dynamic_snippet/000'; const DynamicSnippetEvents = DynamicSnippet.extend({ selector: '.s_event_upcoming_snippet', diff --git a/addons/website_event/static/src/snippets/s_events/options.js b/addons/website_event/static/src/snippets/s_events/options.js index d5c9ada707cd0..123953ad96a3f 100644 --- a/addons/website_event/static/src/snippets/s_events/options.js +++ b/addons/website_event/static/src/snippets/s_events/options.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import options from 'web_editor.snippets.options'; -import dynamicSnippetOptions from 'website.s_dynamic_snippet_options'; +import options from '@web_editor/js/editor/snippets.options'; +import dynamicSnippetOptions from '@website/snippets/s_dynamic_snippet/options'; const dynamicSnippetEventOptions = dynamicSnippetOptions.extend({ /** diff --git a/addons/website_event/static/src/snippets/s_searchbar/000.js b/addons/website_event/static/src/snippets/s_searchbar/000.js index 6522941c4799a..4b0a7be9d2049 100644 --- a/addons/website_event/static/src/snippets/s_searchbar/000.js +++ b/addons/website_event/static/src/snippets/s_searchbar/000.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import publicWidget from 'web.public.widget'; +import publicWidget from '@web/legacy/js/public/public_widget'; publicWidget.registry.searchBar.include({ /** diff --git a/addons/website_event/static/tests/tours/website_event.js b/addons/website_event/static/tests/tours/website_event.js index 43396115182ec..f8a23262fd5fd 100644 --- a/addons/website_event/static/tests/tours/website_event.js +++ b/addons/website_event/static/tests/tours/website_event.js @@ -1,9 +1,9 @@ /** @odoo-module **/ - - import {_t} from "web.core"; - import {Markup} from "web.utils"; - import wTourUtils from "website.tour_utils"; - import "web.legacy_tranlations_loaded"; + + import {_t} from "@web/legacy/js/services/core"; + import { Markup } from "@web/legacy/js/core/utils"; + import wTourUtils from "@website/js/tours/tour_utils"; + import "@web/legacy/translations_loaded"; wTourUtils.registerWebsitePreviewTour("website_event_tour", { diff --git a/addons/website_event_booth/static/src/js/booth_register.js b/addons/website_event_booth/static/src/js/booth_register.js index 166f72a767688..176a5be64e737 100644 --- a/addons/website_event_booth/static/src/js/booth_register.js +++ b/addons/website_event_booth/static/src/js/booth_register.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=website_event_booth.booth_registration **/ +/** @odoo-module **/ -import core from "web.core"; -import publicWidget from "web.public.widget"; +import core from "@web/legacy/js/services/core"; +import publicWidget from "@web/legacy/js/public/public_widget"; var QWeb = core.qweb; var _t = core._t; diff --git a/addons/website_event_booth_exhibitor/static/src/js/booth_sponsor_details.js b/addons/website_event_booth_exhibitor/static/src/js/booth_sponsor_details.js index 22fb7a4ce0500..a19398714ff41 100644 --- a/addons/website_event_booth_exhibitor/static/src/js/booth_sponsor_details.js +++ b/addons/website_event_booth_exhibitor/static/src/js/booth_sponsor_details.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=website_event_booth_exhibitor.booth_sponsor_details **/ +/** @odoo-module **/ -import publicWidget from "web.public.widget"; +import publicWidget from "@web/legacy/js/public/public_widget"; publicWidget.registry.boothSponsorDetails = publicWidget.Widget.extend({ selector: '#o_wbooth_contact_details_form', diff --git a/addons/website_event_booth_exhibitor/static/tests/tours/website_event_booth_exhibitor.js b/addons/website_event_booth_exhibitor/static/tests/tours/website_event_booth_exhibitor.js index e4c8041bc955a..84fada9a21fda 100644 --- a/addons/website_event_booth_exhibitor/static/tests/tours/website_event_booth_exhibitor.js +++ b/addons/website_event_booth_exhibitor/static/tests/tours/website_event_booth_exhibitor.js @@ -1,7 +1,7 @@ /** @odoo-module **/ - + import { registry } from "@web/core/registry"; - import FinalSteps from "website_event_booth_exhibitor.tour_steps"; + import FinalSteps from "@website_event_booth_exhibitor/../tests/tours/website_event_booth_exhibitor_steps"; registry.category("web_tour.tours").add("webooth_exhibitor_register", { diff --git a/addons/website_event_booth_exhibitor/static/tests/tours/website_event_booth_exhibitor_steps.js b/addons/website_event_booth_exhibitor/static/tests/tours/website_event_booth_exhibitor_steps.js index a1d6c28b94276..984c3e096aa51 100644 --- a/addons/website_event_booth_exhibitor/static/tests/tours/website_event_booth_exhibitor_steps.js +++ b/addons/website_event_booth_exhibitor/static/tests/tours/website_event_booth_exhibitor_steps.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=website_event_booth_exhibitor.tour_steps **/ - - import core from "web.core"; +/** @odoo-module **/ + + import core from "@web/legacy/js/services/core"; var FinalSteps = core.Class.extend({ diff --git a/addons/website_event_booth_sale/static/src/js/booth_register.js b/addons/website_event_booth_sale/static/src/js/booth_register.js index dfe1717e10963..f0cba66903fe4 100644 --- a/addons/website_event_booth_sale/static/src/js/booth_register.js +++ b/addons/website_event_booth_sale/static/src/js/booth_register.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import BoothRegistration from "website_event_booth.booth_registration"; +import BoothRegistration from "@website_event_booth/js/booth_register"; /** * This class changes the displayed price after selecting the requested booths. diff --git a/addons/website_event_booth_sale/static/tests/tours/helpers/WebsiteEventBoothSaleTourMethods.js b/addons/website_event_booth_sale/static/tests/tours/helpers/WebsiteEventBoothSaleTourMethods.js index ccd515de414a3..01b4132057aba 100644 --- a/addons/website_event_booth_sale/static/tests/tours/helpers/WebsiteEventBoothSaleTourMethods.js +++ b/addons/website_event_booth_sale/static/tests/tours/helpers/WebsiteEventBoothSaleTourMethods.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=website_event_booth_sale.tour.WebsiteEventBoothSaleTourMethods **/ - - import { changePricelist, checkPriceCart } from "website_event_sale.tour.WebsiteEventSaleTourMethods"; +/** @odoo-module **/ + + import { changePricelist, checkPriceCart } from "@website_event_sale/../tests/tours/helpers/WebsiteEventSaleTourMethods"; function checkPriceBooth(eventName, price, priceSelected) { return [ @@ -45,7 +45,7 @@ }, ] } - const getPriceListChecksSteps = function ({pricelistName, eventName, price, priceSelected, priceCart, priceBeforeDiscount=false}) { + export const getPriceListChecksSteps = function ({pricelistName, eventName, price, priceSelected, priceCart, priceBeforeDiscount=false}) { const checkPriceSteps = priceBeforeDiscount ? checkPriceDiscountBooth(eventName, price, priceSelected, priceBeforeDiscount) : checkPriceBooth(eventName, price, priceSelected); return [ ...changePricelist(pricelistName), diff --git a/addons/website_event_booth_sale/static/tests/tours/website_event_booth_sale_pricelists.js b/addons/website_event_booth_sale/static/tests/tours/website_event_booth_sale_pricelists.js index 1654198a494e8..13f737d9add79 100644 --- a/addons/website_event_booth_sale/static/tests/tours/website_event_booth_sale_pricelists.js +++ b/addons/website_event_booth_sale/static/tests/tours/website_event_booth_sale_pricelists.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { registry } from "@web/core/registry"; -import { getPriceListChecksSteps } from 'website_event_booth_sale.tour.WebsiteEventBoothSaleTourMethods'; +import { getPriceListChecksSteps } from '@website_event_booth_sale/../tests/tours/helpers/WebsiteEventBoothSaleTourMethods'; registry.category("web_tour.tours").add('event_booth_sale_pricelists_different_currencies', { test: true, diff --git a/addons/website_event_booth_sale_exhibitor/static/tests/tours/website_event_booth_sale_exhibitor.js b/addons/website_event_booth_sale_exhibitor/static/tests/tours/website_event_booth_sale_exhibitor.js index 0eb8510c6f948..ccafa3baf1e19 100644 --- a/addons/website_event_booth_sale_exhibitor/static/tests/tours/website_event_booth_sale_exhibitor.js +++ b/addons/website_event_booth_sale_exhibitor/static/tests/tours/website_event_booth_sale_exhibitor.js @@ -1,6 +1,6 @@ /** @odoo-module **/ - - import FinalSteps from "website_event_booth_exhibitor.tour_steps"; + + import FinalSteps from "@website_event_booth_exhibitor/../tests/tours/website_event_booth_exhibitor_steps"; FinalSteps.include({ diff --git a/addons/website_event_exhibitor/static/src/js/event_exhibitor_connect.js b/addons/website_event_exhibitor/static/src/js/event_exhibitor_connect.js index 8eef82b991974..4f33a16d49a6a 100644 --- a/addons/website_event_exhibitor/static/src/js/event_exhibitor_connect.js +++ b/addons/website_event_exhibitor/static/src/js/event_exhibitor_connect.js @@ -1,9 +1,9 @@ -/** @odoo-module alias=website_event_exhibitor.event_exhibitor_connect **/ +/** @odoo-module **/ import { debounce } from "@web/core/utils/timing"; -import Dialog from "web.Dialog"; -import publicWidget from "web.public.widget"; -import {Markup} from "web.utils"; +import Dialog from "@web/legacy/js/core/dialog"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import { Markup } from "@web/legacy/js/core/utils"; var ExhibitorConnectClosedDialog = Dialog.extend({ events: Object.assign({}, Dialog.prototype.events, { diff --git a/addons/website_event_exhibitor/static/src/js/event_sponsor_search.js b/addons/website_event_exhibitor/static/src/js/event_sponsor_search.js index 82cbbad9cca5d..7dfbcf91eaca6 100644 --- a/addons/website_event_exhibitor/static/src/js/event_sponsor_search.js +++ b/addons/website_event_exhibitor/static/src/js/event_sponsor_search.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=website_event_exhibitor.event_sponsor_search **/ +/** @odoo-module **/ -import publicWidget from "web.public.widget"; +import publicWidget from "@web/legacy/js/public/public_widget"; publicWidget.registry.websiteEventSearchSponsor = publicWidget.Widget.extend({ selector: '.o_wesponsor_index', diff --git a/addons/website_event_meet/static/src/js/snippets/options.js b/addons/website_event_meet/static/src/js/snippets/options.js index 18d2aafd58afe..c74ddd458a76d 100644 --- a/addons/website_event_meet/static/src/js/snippets/options.js +++ b/addons/website_event_meet/static/src/js/snippets/options.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import options from 'web_editor.snippets.options'; +import options from '@web_editor/js/editor/snippets.options'; options.registry.WebsiteEvent.include({ diff --git a/addons/website_event_meet/static/src/js/website_event_create_meeting_room_button.js b/addons/website_event_meet/static/src/js/website_event_create_meeting_room_button.js index 346bbafe44e8c..a899784e06aa7 100644 --- a/addons/website_event_meet/static/src/js/website_event_create_meeting_room_button.js +++ b/addons/website_event_meet/static/src/js/website_event_create_meeting_room_button.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=website_event_meet.website_event_create_room_button **/ +/** @odoo-module **/ -import publicWidget from "web.public.widget"; -import core from "web.core"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import core from "@web/legacy/js/services/core"; const QWeb = core.qweb; publicWidget.registry.websiteEventCreateMeetingRoom = publicWidget.Widget.extend({ diff --git a/addons/website_event_meet/static/src/js/website_event_meeting_room.js b/addons/website_event_meet/static/src/js/website_event_meeting_room.js index a5cba77c8bac4..7df001c03521f 100644 --- a/addons/website_event_meet/static/src/js/website_event_meeting_room.js +++ b/addons/website_event_meet/static/src/js/website_event_meeting_room.js @@ -1,8 +1,8 @@ -/** @odoo-module alias=website_event_meet.website_event_meet_meeting_room **/ +/** @odoo-module **/ -import publicWidget from "web.public.widget"; -import core from "web.core"; -import Dialog from "web.Dialog"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import core from "@web/legacy/js/services/core"; +import Dialog from "@web/legacy/js/core/dialog"; const _t = core._t; publicWidget.registry.websiteEventMeetingRoom = publicWidget.Widget.extend({ diff --git a/addons/website_event_sale/static/src/js/website_event_sale_ticket_details.js b/addons/website_event_sale/static/src/js/website_event_sale_ticket_details.js index 6ba04594aea5b..8cbd276b138b5 100644 --- a/addons/website_event_sale/static/src/js/website_event_sale_ticket_details.js +++ b/addons/website_event_sale/static/src/js/website_event_sale_ticket_details.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import publicWidget from 'web.public.widget'; +import publicWidget from '@web/legacy/js/public/public_widget'; publicWidget.registry.ticketDetailsWidget.include({ /** diff --git a/addons/website_event_sale/static/tests/tours/helpers/WebsiteEventSaleTourMethods.js b/addons/website_event_sale/static/tests/tours/helpers/WebsiteEventSaleTourMethods.js index d2d4edaa3abef..9bee915d3c4f0 100644 --- a/addons/website_event_sale/static/tests/tours/helpers/WebsiteEventSaleTourMethods.js +++ b/addons/website_event_sale/static/tests/tours/helpers/WebsiteEventSaleTourMethods.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=website_event_sale.tour.WebsiteEventSaleTourMethods **/ - - function changePricelist(pricelistName) { +/** @odoo-module **/ + + export function changePricelist(pricelistName) { return [ { content: "Go to page Shop", @@ -50,7 +50,7 @@ }, ] } - function checkPriceCart(price) { + export function checkPriceCart(price) { return [ { content: "Go to page Cart", @@ -63,7 +63,7 @@ }, ] } - const getPriceListChecksSteps = function ({pricelistName, eventName, price, priceBeforeDiscount=false}) { + export const getPriceListChecksSteps = function ({pricelistName, eventName, price, priceBeforeDiscount=false}) { const checkPriceSteps = priceBeforeDiscount ? checkPriceDiscountEvent(eventName, price, priceBeforeDiscount) : checkPriceEvent(eventName, price); return [ ...changePricelist(pricelistName), diff --git a/addons/website_event_sale/static/tests/tours/website_event_sale_pricelists.js b/addons/website_event_sale/static/tests/tours/website_event_sale_pricelists.js index 5dfbff3525e40..52301b2994830 100644 --- a/addons/website_event_sale/static/tests/tours/website_event_sale_pricelists.js +++ b/addons/website_event_sale/static/tests/tours/website_event_sale_pricelists.js @@ -1,7 +1,7 @@ /** @odoo-module **/ - + import { registry } from "@web/core/registry"; - import { getPriceListChecksSteps } from "website_event_sale.tour.WebsiteEventSaleTourMethods"; + import { getPriceListChecksSteps } from "@website_event_sale/../tests/tours/helpers/WebsiteEventSaleTourMethods"; registry.category("web_tour.tours").add('event_sale_pricelists_different_currencies', { test: true, diff --git a/addons/website_event_track/static/src/js/event_track_reminder.js b/addons/website_event_track/static/src/js/event_track_reminder.js index f095cf449852e..351a3bb37ec57 100644 --- a/addons/website_event_track/static/src/js/event_track_reminder.js +++ b/addons/website_event_track/static/src/js/event_track_reminder.js @@ -1,10 +1,10 @@ -/** @odoo-module alias=website_event_track.website_event_track_reminder **/ +/** @odoo-module **/ import { sprintf } from "@web/core/utils/strings"; import { debounce } from "@web/core/utils/timing"; -import core from "web.core"; +import core from "@web/legacy/js/services/core"; var _t = core._t; -import publicWidget from "web.public.widget"; +import publicWidget from "@web/legacy/js/public/public_widget"; publicWidget.registry.websiteEventTrackReminder = publicWidget.Widget.extend({ selector: '.o_wetrack_js_reminder', diff --git a/addons/website_event_track/static/src/js/event_track_timer.js b/addons/website_event_track/static/src/js/event_track_timer.js index 59be381217737..c7cd4b8808aa3 100644 --- a/addons/website_event_track/static/src/js/event_track_timer.js +++ b/addons/website_event_track/static/src/js/event_track_timer.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=website_event_track.website_event_track_timer **/ +/** @odoo-module **/ -import publicWidget from "web.public.widget"; +import publicWidget from "@web/legacy/js/public/public_widget"; const { DateTime } = luxon; /* diff --git a/addons/website_event_track/static/src/js/website_event_pwa_widget.js b/addons/website_event_track/static/src/js/website_event_pwa_widget.js index 75814b2950dd7..46cb3e2984758 100644 --- a/addons/website_event_track/static/src/js/website_event_pwa_widget.js +++ b/addons/website_event_track/static/src/js/website_event_pwa_widget.js @@ -1,5 +1,5 @@ -/** @odoo-module alias=website_event_track.website_event_pwa_widget **/ - +/** @odoo-module **/ + /* * The "deferredPrompt" Promise will resolve only if the "beforeinstallprompt" event * has been triggered. It allows to register this listener as soon as possible @@ -15,8 +15,8 @@ }); }); - import config from "web.config"; - import publicWidget from "web.public.widget"; + import config from "@web/legacy/js/services/config"; + import publicWidget from "@web/legacy/js/public/public_widget"; var PWAInstallBanner = publicWidget.Widget.extend({ template: "pwa_install_banner", diff --git a/addons/website_event_track/static/src/js/website_event_track.js b/addons/website_event_track/static/src/js/website_event_track.js index 24c01f0142179..18e71694e559d 100644 --- a/addons/website_event_track/static/src/js/website_event_track.js +++ b/addons/website_event_track/static/src/js/website_event_track.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import publicWidget from "web.public.widget"; +import publicWidget from "@web/legacy/js/public/public_widget"; publicWidget.registry.websiteEventTrack = publicWidget.Widget.extend({ selector: '.o_wevent_event', diff --git a/addons/website_event_track/static/src/js/website_event_track_proposal_form.js b/addons/website_event_track/static/src/js/website_event_track_proposal_form.js index d30a7cc9b62e4..4b5e0cd00a3fe 100644 --- a/addons/website_event_track/static/src/js/website_event_track_proposal_form.js +++ b/addons/website_event_track/static/src/js/website_event_track_proposal_form.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=website_event_track.website_event_track_proposal_form **/ +/** @odoo-module **/ -import core from "web.core"; -import publicWidget from "web.public.widget"; +import core from "@web/legacy/js/services/core"; +import publicWidget from "@web/legacy/js/public/public_widget"; var QWeb = core.qweb; var _t = core._t; diff --git a/addons/website_event_track/static/src/js/website_event_track_proposal_form_tags.js b/addons/website_event_track/static/src/js/website_event_track_proposal_form_tags.js index d590e013c9d4a..fb7c9dd9bd3b7 100644 --- a/addons/website_event_track/static/src/js/website_event_track_proposal_form_tags.js +++ b/addons/website_event_track/static/src/js/website_event_track_proposal_form_tags.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=website_event_track.website_event_track_proposal_form_tags **/ +/** @odoo-module **/ -import core from "web.core"; -import publicWidget from "web.public.widget"; +import core from "@web/legacy/js/services/core"; +import publicWidget from "@web/legacy/js/public/public_widget"; var _t = core._t; diff --git a/addons/website_event_track_live/static/src/js/website_event_track_live.js b/addons/website_event_track_live/static/src/js/website_event_track_live.js index d44eaa253957c..3edef242cefdf 100644 --- a/addons/website_event_track_live/static/src/js/website_event_track_live.js +++ b/addons/website_event_track_live/static/src/js/website_event_track_live.js @@ -1,9 +1,9 @@ /** @odoo-module **/ /* global YT */ -import publicWidget from "web.public.widget"; -import TrackSuggestionWidget from "website_event_track_live.website_event_track_suggestion"; -import ReplaySuggestionWidget from "website_event_track_live.website_event_track_replay_suggestion"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import TrackSuggestionWidget from "@website_event_track_live/js/website_event_track_suggestion"; +import ReplaySuggestionWidget from "@website_event_track_live/js/website_event_track_replay_suggestion"; publicWidget.registry.websiteEventTrackLive = publicWidget.Widget.extend({ selector: '.o_wevent_event_track_live', diff --git a/addons/website_event_track_live/static/src/js/website_event_track_replay_suggestion.js b/addons/website_event_track_live/static/src/js/website_event_track_replay_suggestion.js index fb2723503ade3..85e90fa2ff71a 100644 --- a/addons/website_event_track_live/static/src/js/website_event_track_replay_suggestion.js +++ b/addons/website_event_track_live/static/src/js/website_event_track_replay_suggestion.js @@ -1,13 +1,13 @@ -/** @odoo-module alias=website_event_track_live.website_event_track_replay_suggestion **/ +/** @odoo-module **/ -import { Widget } from "web.public.widget"; +import { PublicWidget } from "@web/legacy/js/public/public_widget"; /** * The widget will have the responsibility to manage the interactions between the * Youtube player and the cover containing a replay button. This widget will * be used when no suggestion can be found in order to hide the Youtube suggestions. */ -var WebsiteEventReplaySuggestion = Widget.extend({ +var WebsiteEventReplaySuggestion = PublicWidget.extend({ template: 'website_event_track_live.website_event_track_replay_suggestion', events: { 'click .owevent_track_suggestion_replay': '_onReplayClick' diff --git a/addons/website_event_track_live/static/src/js/website_event_track_suggestion.js b/addons/website_event_track_live/static/src/js/website_event_track_suggestion.js index 56f4e0ee83ada..95dbe44e3d09a 100644 --- a/addons/website_event_track_live/static/src/js/website_event_track_suggestion.js +++ b/addons/website_event_track_live/static/src/js/website_event_track_suggestion.js @@ -1,8 +1,8 @@ -/** @odoo-module alias=website_event_track_live.website_event_track_suggestion **/ +/** @odoo-module **/ -import { Widget } from "web.public.widget"; +import { PublicWidget } from "@web/legacy/js/public/public_widget"; -var WebsiteEventTrackSuggestion = Widget.extend({ +var WebsiteEventTrackSuggestion = PublicWidget.extend({ template: 'website_event_track_live.website_event_track_suggestion', events: { 'click .owevent_track_suggestion_next': '_onNextTrackClick', diff --git a/addons/website_event_track_live_quiz/static/src/js/event_quiz.js b/addons/website_event_track_live_quiz/static/src/js/event_quiz.js index ccd1afc0b791a..36d3c794c0770 100644 --- a/addons/website_event_track_live_quiz/static/src/js/event_quiz.js +++ b/addons/website_event_track_live_quiz/static/src/js/event_quiz.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=website_event_track_live_quiz.event_quiz **/ +/** @odoo-module **/ -import Quiz from "website_event_track_quiz.event.quiz"; +import Quiz from "@website_event_track_quiz/js/event_quiz"; var WebsiteEventTrackSuggestionQuiz = Quiz.include({ /** diff --git a/addons/website_event_track_live_quiz/static/src/js/website_event_track_suggestion.js b/addons/website_event_track_live_quiz/static/src/js/website_event_track_suggestion.js index a5f32c4babfd7..d65214f26c46e 100644 --- a/addons/website_event_track_live_quiz/static/src/js/website_event_track_suggestion.js +++ b/addons/website_event_track_live_quiz/static/src/js/website_event_track_suggestion.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=website_event_track_live_quiz.website_event_track_suggestion **/ +/** @odoo-module **/ -import WebsiteEventTrackSuggestion from "website_event_track_live.website_event_track_suggestion"; +import WebsiteEventTrackSuggestion from "@website_event_track_live/js/website_event_track_suggestion"; var WebsiteEventTrackSuggestionLiveQuiz = WebsiteEventTrackSuggestion.include({ events: Object.assign({}, WebsiteEventTrackSuggestion.prototype.events, { diff --git a/addons/website_event_track_quiz/static/src/js/event_quiz.js b/addons/website_event_track_quiz/static/src/js/event_quiz.js index 895c136b093fd..e51db17fcf4fb 100644 --- a/addons/website_event_track_quiz/static/src/js/event_quiz.js +++ b/addons/website_event_track_quiz/static/src/js/event_quiz.js @@ -1,8 +1,8 @@ -/** @odoo-module alias=website_event_track_quiz.event.quiz **/ +/** @odoo-module **/ -import publicWidget from "web.public.widget"; -import core from "web.core"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import core from "@web/legacy/js/services/core"; import session from "web.session"; var QWeb = core.qweb; diff --git a/addons/website_event_track_quiz/static/src/js/event_quiz_leaderboard.js b/addons/website_event_track_quiz/static/src/js/event_quiz_leaderboard.js index 3aac128473dca..65b8a862a4fc7 100644 --- a/addons/website_event_track_quiz/static/src/js/event_quiz_leaderboard.js +++ b/addons/website_event_track_quiz/static/src/js/event_quiz_leaderboard.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=website_event_track_quiz.event_leaderboard **/ +/** @odoo-module **/ -import publicWidget from "web.public.widget"; +import publicWidget from "@web/legacy/js/public/public_widget"; publicWidget.registry.EventLeaderboard = publicWidget.Widget.extend({ selector: '.o_wevent_quiz_leaderboard', diff --git a/addons/website_form_project/static/src/js/website_form_project_editor.js b/addons/website_form_project/static/src/js/website_form_project_editor.js index 8905b33f3172d..758bc7c5d1fbd 100644 --- a/addons/website_form_project/static/src/js/website_form_project_editor.js +++ b/addons/website_form_project/static/src/js/website_form_project_editor.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import core from "web.core"; -import FormEditorRegistry from "website.form_editor_registry"; +import core from "@web/legacy/js/services/core"; +import FormEditorRegistry from "@website/js/form_editor_registry"; var _t = core._t; diff --git a/addons/website_forum/static/src/js/systray_items/new_content.js b/addons/website_forum/static/src/js/systray_items/new_content.js index 29d2fae6b8b60..6023685c4508b 100644 --- a/addons/website_forum/static/src/js/systray_items/new_content.js +++ b/addons/website_forum/static/src/js/systray_items/new_content.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { NewContentModal, MODULE_STATUS } from '@website/systray_items/new_content'; -import { patch } from 'web.utils'; +import { patch } from '@web/legacy/js/core/utils'; patch(NewContentModal.prototype, 'website_forum_new_content', { setup() { diff --git a/addons/website_forum/static/src/js/tours/website_forum.js b/addons/website_forum/static/src/js/tours/website_forum.js index d09371d0690fe..15dc5f67b5b52 100644 --- a/addons/website_forum/static/src/js/tours/website_forum.js +++ b/addons/website_forum/static/src/js/tours/website_forum.js @@ -1,8 +1,8 @@ /** @odoo-module **/ - - import core from "web.core"; - import wTourUtils from "website.tour_utils"; - import "web.legacy_tranlations_loaded"; + + import core from "@web/legacy/js/services/core"; + import wTourUtils from "@website/js/tours/tour_utils"; + import "@web/legacy/translations_loaded"; var _t = core._t; diff --git a/addons/website_forum/static/src/js/website_forum.js b/addons/website_forum/static/src/js/website_forum.js index 5ab84fb400af2..ed7213dcb02d3 100644 --- a/addons/website_forum/static/src/js/website_forum.js +++ b/addons/website_forum/static/src/js/website_forum.js @@ -1,12 +1,12 @@ /** @odoo-module **/ -import dom from "web.dom"; -import core from "web.core"; -import {setCookie} from "web.utils.cookies"; -import Dialog from "web.Dialog"; +import dom from "@web/legacy/js/core/dom"; +import core from "@web/legacy/js/services/core"; +import {setCookie} from "@web/legacy/js/core/cookie_utils"; +import Dialog from "@web/legacy/js/core/dialog"; import { loadWysiwygFromTextarea } from "@web_editor/js/frontend/loadWysiwygFromTextarea"; -import publicWidget from "web.public.widget"; -import { Markup } from "web.utils"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import { Markup } from '@web/legacy/js/core/utils'; import session from "web.session"; import { escape, sprintf } from "@web/core/utils/strings"; var qweb = core.qweb; diff --git a/addons/website_forum/static/src/js/website_forum.share.js b/addons/website_forum/static/src/js/website_forum.share.js index 33aa5e7a19d45..1b3a0fe44ff40 100644 --- a/addons/website_forum/static/src/js/website_forum.share.js +++ b/addons/website_forum/static/src/js/website_forum.share.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import core from "web.core"; -import publicWidget from "web.public.widget"; -import "website.content.snippets.animation"; +import core from "@web/legacy/js/services/core"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import "@website/js/content/snippets.animation"; var qweb = core.qweb; diff --git a/addons/website_hr_recruitment/static/src/js/systray_items/new_content.js b/addons/website_hr_recruitment/static/src/js/systray_items/new_content.js index 459a71e522864..07f248efecaf3 100644 --- a/addons/website_hr_recruitment/static/src/js/systray_items/new_content.js +++ b/addons/website_hr_recruitment/static/src/js/systray_items/new_content.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { NewContentModal, MODULE_STATUS } from '@website/systray_items/new_content'; -import { patch } from 'web.utils'; +import { patch } from '@web/legacy/js/core/utils'; patch(NewContentModal.prototype, 'website_hr_recruitment_new_content', { setup() { diff --git a/addons/website_hr_recruitment/static/src/js/website_hr_recruitment_editor.js b/addons/website_hr_recruitment/static/src/js/website_hr_recruitment_editor.js index aa544e29a887f..dbcb1e467fb9a 100644 --- a/addons/website_hr_recruitment/static/src/js/website_hr_recruitment_editor.js +++ b/addons/website_hr_recruitment/static/src/js/website_hr_recruitment_editor.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import core from "web.core"; -import FormEditorRegistry from "website.form_editor_registry"; +import core from "@web/legacy/js/services/core"; +import FormEditorRegistry from "@website/js/form_editor_registry"; var _t = core._t; diff --git a/addons/website_hr_recruitment/static/tests/tours/website_hr_recruitment.js b/addons/website_hr_recruitment/static/tests/tours/website_hr_recruitment.js index 38b8526cd812c..9d670bac37892 100644 --- a/addons/website_hr_recruitment/static/tests/tours/website_hr_recruitment.js +++ b/addons/website_hr_recruitment/static/tests/tours/website_hr_recruitment.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=website_hr_recruitment.tour **/ - +/** @odoo-module **/ + import { registry } from "@web/core/registry"; - import wTourUtils from "website.tour_utils"; + import wTourUtils from "@website/js/tours/tour_utils"; function applyForAJob(jobName, application) { return [{ diff --git a/addons/website_jitsi/static/src/js/chat_room.js b/addons/website_jitsi/static/src/js/chat_room.js index dc821c189d2fe..a559653e41f65 100644 --- a/addons/website_jitsi/static/src/js/chat_room.js +++ b/addons/website_jitsi/static/src/js/chat_room.js @@ -1,8 +1,8 @@ -/** @odoo-module alias=website_jitsi.chat_room **/ +/** @odoo-module **/ -import config from "web.config"; -import core from "web.core"; -import publicWidget from "web.public.widget"; +import config from "@web/legacy/js/services/config"; +import core from "@web/legacy/js/services/core"; +import publicWidget from "@web/legacy/js/public/public_widget"; const QWeb = core.qweb; publicWidget.registry.ChatRoom = publicWidget.Widget.extend({ diff --git a/addons/website_links/static/src/js/website_links.js b/addons/website_links/static/src/js/website_links.js index 0d0f45f27a9b1..4a1b8799bf8a8 100644 --- a/addons/website_links/static/src/js/website_links.js +++ b/addons/website_links/static/src/js/website_links.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=website_links.website_links **/ +/** @odoo-module **/ -import core from "web.core"; -import publicWidget from "web.public.widget"; +import core from "@web/legacy/js/services/core"; +import publicWidget from "@web/legacy/js/public/public_widget"; var _t = core._t; diff --git a/addons/website_links/static/src/js/website_links_charts.js b/addons/website_links/static/src/js/website_links_charts.js index f851a5f71eb2c..376ed2fc2f332 100644 --- a/addons/website_links/static/src/js/website_links_charts.js +++ b/addons/website_links/static/src/js/website_links_charts.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=website_links.charts **/ +/** @odoo-module **/ -import core from "web.core"; -import publicWidget from "web.public.widget"; +import core from "@web/legacy/js/services/core"; +import publicWidget from "@web/legacy/js/public/public_widget"; var _t = core._t; diff --git a/addons/website_links/static/src/js/website_links_code_editor.js b/addons/website_links/static/src/js/website_links_code_editor.js index c32c3edb6d3aa..3de4645c68f25 100644 --- a/addons/website_links/static/src/js/website_links_code_editor.js +++ b/addons/website_links/static/src/js/website_links_code_editor.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import core from "web.core"; -import publicWidget from "web.public.widget"; +import core from "@web/legacy/js/services/core"; +import publicWidget from "@web/legacy/js/public/public_widget"; var _t = core._t; diff --git a/addons/website_livechat/static/src/js/systray_items/new_content.js b/addons/website_livechat/static/src/js/systray_items/new_content.js index edd5f90d639fd..abe966ba1ec4d 100644 --- a/addons/website_livechat/static/src/js/systray_items/new_content.js +++ b/addons/website_livechat/static/src/js/systray_items/new_content.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { NewContentModal, MODULE_STATUS } from '@website/systray_items/new_content'; -import { patch } from 'web.utils'; +import { patch } from '@web/legacy/js/core/utils'; patch(NewContentModal.prototype, 'website_livechat_new_content', { setup() { diff --git a/addons/website_mail/static/src/js/follow.js b/addons/website_mail/static/src/js/follow.js index 77ee1b7e7a7e9..1c8770a8dd9fd 100644 --- a/addons/website_mail/static/src/js/follow.js +++ b/addons/website_mail/static/src/js/follow.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import publicWidget from "web.public.widget"; +import publicWidget from "@web/legacy/js/public/public_widget"; publicWidget.registry.follow = publicWidget.Widget.extend({ selector: '#wrapwrap:has(.js_follow)', diff --git a/addons/website_mail_group/static/src/snippets/s_group/000.js b/addons/website_mail_group/static/src/snippets/s_group/000.js index ec97af604ab80..20c1c3de36c6f 100644 --- a/addons/website_mail_group/static/src/snippets/s_group/000.js +++ b/addons/website_mail_group/static/src/snippets/s_group/000.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import core from "web.core"; +import core from "@web/legacy/js/services/core"; const _t = core._t; -import MailGroup from "mail_group.mail_group"; +import MailGroup from "@mail_group/js/mail_group"; MailGroup.include({ start: async function () { diff --git a/addons/website_mail_group/static/src/snippets/s_group/options.js b/addons/website_mail_group/static/src/snippets/s_group/options.js index ddcf83f0caf00..9474388e7af7f 100644 --- a/addons/website_mail_group/static/src/snippets/s_group/options.js +++ b/addons/website_mail_group/static/src/snippets/s_group/options.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import core from "web.core"; -import options from "web_editor.snippets.options"; -import wUtils from "website.utils"; +import core from "@web/legacy/js/services/core"; +import options from "@web_editor/js/editor/snippets.options"; +import wUtils from "@website/js/utils"; const _t = core._t; options.registry.Group = options.Class.extend({ diff --git a/addons/website_mass_mailing/static/src/js/mass_mailing_form_editor.js b/addons/website_mass_mailing/static/src/js/mass_mailing_form_editor.js index 72c71b57011b5..ca95d2b2796f1 100644 --- a/addons/website_mass_mailing/static/src/js/mass_mailing_form_editor.js +++ b/addons/website_mass_mailing/static/src/js/mass_mailing_form_editor.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import core from "web.core"; -import FormEditorRegistry from "website.form_editor_registry"; +import core from "@web/legacy/js/services/core"; +import FormEditorRegistry from "@website/js/form_editor_registry"; const _t = core._t; diff --git a/addons/website_mass_mailing/static/src/js/website_mass_mailing.editor.js b/addons/website_mass_mailing/static/src/js/website_mass_mailing.editor.js index e85d04b3ca385..a153c7aa66cad 100644 --- a/addons/website_mass_mailing/static/src/js/website_mass_mailing.editor.js +++ b/addons/website_mass_mailing/static/src/js/website_mass_mailing.editor.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import core from "web.core"; -import Dialog from "web.Dialog"; -import options from "web_editor.snippets.options"; +import core from "@web/legacy/js/services/core"; +import Dialog from "@web/legacy/js/core/dialog"; +import options from "@web_editor/js/editor/snippets.options"; const qweb = core.qweb; var _t = core._t; diff --git a/addons/website_mass_mailing/static/src/js/website_mass_mailing.js b/addons/website_mass_mailing/static/src/js/website_mass_mailing.js index d48eede6d4f64..cc2c47f2a2913 100644 --- a/addons/website_mass_mailing/static/src/js/website_mass_mailing.js +++ b/addons/website_mass_mailing/static/src/js/website_mass_mailing.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import core from "web.core"; -import publicWidget from "web.public.widget"; -import {ReCaptcha} from "google_recaptcha.ReCaptchaV3"; +import core from "@web/legacy/js/services/core"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import {ReCaptcha} from "@google_recaptcha/js/recaptcha"; var _t = core._t; diff --git a/addons/website_mass_mailing/static/src/snippets/s_popup/000.js b/addons/website_mass_mailing/static/src/snippets/s_popup/000.js index 85c70f9e509a3..52a158743fa84 100644 --- a/addons/website_mass_mailing/static/src/snippets/s_popup/000.js +++ b/addons/website_mass_mailing/static/src/snippets/s_popup/000.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import PopupWidget from 'website.s_popup'; +import PopupWidget from '@website/snippets/s_popup/000'; PopupWidget.include({ diff --git a/addons/website_mass_mailing/static/src/snippets/s_popup/options.js b/addons/website_mass_mailing/static/src/snippets/s_popup/options.js index 2b85bc833ab7b..9938e9a0c2b8d 100644 --- a/addons/website_mass_mailing/static/src/snippets/s_popup/options.js +++ b/addons/website_mass_mailing/static/src/snippets/s_popup/options.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import options from 'web_editor.snippets.options'; +import options from '@web_editor/js/editor/snippets.options'; options.registry.NewsletterLayout = options.registry.SelectTemplate.extend({ /** diff --git a/addons/website_mass_mailing/static/tests/tours/snippet_newsletter_block_with_edit.js b/addons/website_mass_mailing/static/tests/tours/snippet_newsletter_block_with_edit.js index 02f42b61c596f..38b20e68d3c84 100644 --- a/addons/website_mass_mailing/static/tests/tours/snippet_newsletter_block_with_edit.js +++ b/addons/website_mass_mailing/static/tests/tours/snippet_newsletter_block_with_edit.js @@ -1,6 +1,6 @@ /** @odoo-module */ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; wTourUtils.registerWebsitePreviewTour('snippet_newsletter_block_with_edit', { test: true, diff --git a/addons/website_mass_mailing/static/tests/tours/snippet_newsletter_popup_edition.js b/addons/website_mass_mailing/static/tests/tours/snippet_newsletter_popup_edition.js index 55fe0ee30ccf8..c9f08a2b40cd8 100644 --- a/addons/website_mass_mailing/static/tests/tours/snippet_newsletter_popup_edition.js +++ b/addons/website_mass_mailing/static/tests/tours/snippet_newsletter_popup_edition.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import wTourUtils from "website.tour_utils"; -import snippetNewsletterPopupUseTour from "website_mass_mailing.tour.snippet_newsletter_popup_use"; +import wTourUtils from "@website/js/tours/tour_utils"; +import snippetNewsletterPopupUseTour from "@website_mass_mailing/../tests/tours/snippet_newsletter_popup_use"; wTourUtils.registerWebsitePreviewTour("snippet_newsletter_popup_edition", { test: true, diff --git a/addons/website_mass_mailing/static/tests/tours/snippet_newsletter_popup_use.js b/addons/website_mass_mailing/static/tests/tours/snippet_newsletter_popup_use.js index e338912288946..2a40a85e37dfe 100644 --- a/addons/website_mass_mailing/static/tests/tours/snippet_newsletter_popup_use.js +++ b/addons/website_mass_mailing/static/tests/tours/snippet_newsletter_popup_use.js @@ -1,4 +1,4 @@ -/** @odoo-module alias=website_mass_mailing.tour.snippet_newsletter_popup_use **/ +/** @odoo-module **/ import { registry } from "@web/core/registry"; diff --git a/addons/website_payment/static/src/js/website_payment_donation.js b/addons/website_payment/static/src/js/website_payment_donation.js index 8a1ef76362407..6183b02b30414 100644 --- a/addons/website_payment/static/src/js/website_payment_donation.js +++ b/addons/website_payment/static/src/js/website_payment_donation.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import publicWidget from 'web.public.widget'; +import publicWidget from '@web/legacy/js/public/public_widget'; publicWidget.registry.WebsitePaymentDonation = publicWidget.Widget.extend({ selector: '.o_donation_payment_form', diff --git a/addons/website_payment/static/src/js/website_payment_form.js b/addons/website_payment/static/src/js/website_payment_form.js index a72cf572e0a21..459c1e48b3c53 100644 --- a/addons/website_payment/static/src/js/website_payment_form.js +++ b/addons/website_payment/static/src/js/website_payment_form.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import core, { _t } from 'web.core'; -import checkoutForm from 'payment.checkout_form'; +import core, { _t } from "@web/legacy/js/services/core"; +import checkoutForm from '@payment/js/checkout_form'; import { sprintf } from '@web/core/utils/strings'; checkoutForm.include({ @@ -22,9 +22,9 @@ checkoutForm.include({ //-------------------------------------------------------------------------- /** - * Perform some validations for donations before performing payment + * Perform some validations for donations before performing payment * - * @override method from payment.payment_form_mixin + * @override method from @payment/js/payment_form_mixin * @private * @param {string} code - The code of the payment option's provider * @param {number} paymentOptionId - The id of the payment option handling the transaction @@ -67,7 +67,7 @@ checkoutForm.include({ /** * Add params used by the donation snippet to the transaction route params. * - * @override method from payment.payment_form_mixin + * @override method from @payment/js/payment_form_mixin * @private * @param {string} code - The code of the selected payment option's provider * @param {number} paymentOptionId - The id of the selected payment option diff --git a/addons/website_payment/static/src/snippets/s_donation/000.js b/addons/website_payment/static/src/snippets/s_donation/000.js index 051b5ad7b4e28..66c5300f24902 100644 --- a/addons/website_payment/static/src/snippets/s_donation/000.js +++ b/addons/website_payment/static/src/snippets/s_donation/000.js @@ -1,8 +1,8 @@ /** @odoo-module **/ import { sprintf } from '@web/core/utils/strings'; -import {_t} from 'web.core'; -import publicWidget from 'web.public.widget'; +import {_t} from "@web/legacy/js/services/core"; +import publicWidget from '@web/legacy/js/public/public_widget'; const CUSTOM_BUTTON_EXTRA_WIDTH = 10; diff --git a/addons/website_payment/static/src/snippets/s_donation/options.js b/addons/website_payment/static/src/snippets/s_donation/options.js index 280e98e21423e..a07c2e0e92916 100644 --- a/addons/website_payment/static/src/snippets/s_donation/options.js +++ b/addons/website_payment/static/src/snippets/s_donation/options.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import {_t, qweb} from 'web.core'; -import options from 'web_editor.snippets.options'; +import {_t, qweb} from "@web/legacy/js/services/core"; +import options from '@web_editor/js/editor/snippets.options'; options.registry.Donation = options.Class.extend({ /** diff --git a/addons/website_profile/static/src/js/website_profile.js b/addons/website_profile/static/src/js/website_profile.js index 8c59b252f6fc7..a1bfcd50632b8 100644 --- a/addons/website_profile/static/src/js/website_profile.js +++ b/addons/website_profile/static/src/js/website_profile.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=website_profile.website_profile **/ +/** @odoo-module **/ -import publicWidget from "web.public.widget"; +import publicWidget from "@web/legacy/js/public/public_widget"; import { loadWysiwygFromTextarea } from "@web_editor/js/frontend/loadWysiwygFromTextarea"; publicWidget.registry.websiteProfile = publicWidget.Widget.extend({ diff --git a/addons/website_sale/static/src/js/components/wysiwyg_adapter/wysiwyg_adapter.js b/addons/website_sale/static/src/js/components/wysiwyg_adapter/wysiwyg_adapter.js index 6d682df359472..ed9b376a0ba0f 100644 --- a/addons/website_sale/static/src/js/components/wysiwyg_adapter/wysiwyg_adapter.js +++ b/addons/website_sale/static/src/js/components/wysiwyg_adapter/wysiwyg_adapter.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { WysiwygAdapterComponent } from '@website/components/wysiwyg_adapter/wysiwyg_adapter'; -import { patch } from 'web.utils'; +import { patch } from '@web/legacy/js/core/utils'; // TODO this whole patch actually seems unnecessary. The bug it solved seems // to stay solved if this is removed. To investigate. diff --git a/addons/website_sale/static/src/js/sale_variant_mixin.js b/addons/website_sale/static/src/js/sale_variant_mixin.js index 30c8bbb58f43d..341d1f014f970 100644 --- a/addons/website_sale/static/src/js/sale_variant_mixin.js +++ b/addons/website_sale/static/src/js/sale_variant_mixin.js @@ -1,9 +1,9 @@ -/** @odoo-module alias=website_sale.SaleVariantMixin **/ +/** @odoo-module **/ -import concurrency from "web.concurrency"; -import core from "web.core"; -import utils from "web.utils"; -import ajax from "web.ajax"; +import concurrency from "@web/legacy/js/core/concurrency"; +import core from "@web/legacy/js/services/core"; +import utils from "@web/legacy/js/core/utils"; +import ajax from "@web/legacy/js/core/ajax"; import { sprintf } from "@web/core/utils/strings"; import { memoize, uniqueId } from "@web/core/utils/functions"; import { throttleForAnimation } from "@web/core/utils/timing"; diff --git a/addons/website_sale/static/src/js/systray_items/new_content.js b/addons/website_sale/static/src/js/systray_items/new_content.js index f3bbcefddb3f1..715269792301c 100644 --- a/addons/website_sale/static/src/js/systray_items/new_content.js +++ b/addons/website_sale/static/src/js/systray_items/new_content.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { NewContentModal, MODULE_STATUS } from '@website/systray_items/new_content'; -import { patch } from 'web.utils'; +import { patch } from '@web/legacy/js/core/utils'; patch(NewContentModal.prototype, 'website_sale_new_content', { setup() { diff --git a/addons/website_sale/static/src/js/tours/tour_utils.js b/addons/website_sale/static/src/js/tours/tour_utils.js index 1fb813148bcf9..49ae46633a7f6 100644 --- a/addons/website_sale/static/src/js/tours/tour_utils.js +++ b/addons/website_sale/static/src/js/tours/tour_utils.js @@ -1,9 +1,9 @@ -/** @odoo-module alias=website_sale.tour_utils **/ - -import core from "web.core"; +/** @odoo-module **/ + +import core from "@web/legacy/js/services/core"; const _t = core._t; -import wTourUtils from "website.tour_utils"; -import "web.legacy_tranlations_loaded"; +import wTourUtils from "@website/js/tours/tour_utils"; +import "@web/legacy/translations_loaded"; function addToCart({productName, search = true, productHasVariants = false}) { const steps = []; diff --git a/addons/website_sale/static/src/js/tours/website_sale_shop.js b/addons/website_sale/static/src/js/tours/website_sale_shop.js index 4a578936d242c..957a6222d0dd4 100644 --- a/addons/website_sale/static/src/js/tours/website_sale_shop.js +++ b/addons/website_sale/static/src/js/tours/website_sale_shop.js @@ -1,9 +1,9 @@ /** @odoo-module **/ - - import {_t} from "web.core"; - import {Markup} from "web.utils"; - import wTourUtils from "website.tour_utils"; - import "web.legacy_tranlations_loaded"; + + import {_t} from "@web/legacy/js/services/core"; + import { Markup } from "@web/legacy/js/core/utils"; + import wTourUtils from "@website/js/tours/tour_utils"; + import "@web/legacy/translations_loaded"; wTourUtils.registerWebsitePreviewTour("shop", { url: '/shop', diff --git a/addons/website_sale/static/src/js/variant_mixin.js b/addons/website_sale/static/src/js/variant_mixin.js index c6d59baabbf95..136d35cbb2b89 100644 --- a/addons/website_sale/static/src/js/variant_mixin.js +++ b/addons/website_sale/static/src/js/variant_mixin.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=website_sale.VariantMixin **/ +/** @odoo-module **/ -import VariantMixin from "website_sale.SaleVariantMixin"; +import VariantMixin from "@website_sale/js/sale_variant_mixin"; /** * Website behavior is slightly different from backend so we append diff --git a/addons/website_sale/static/src/js/website_sale.editor.js b/addons/website_sale/static/src/js/website_sale.editor.js index d08f9e7474448..584043b7cd76b 100644 --- a/addons/website_sale/static/src/js/website_sale.editor.js +++ b/addons/website_sale/static/src/js/website_sale.editor.js @@ -1,15 +1,15 @@ /** @odoo-module **/ -import options from "web_editor.snippets.options"; +import options from "@web_editor/js/editor/snippets.options"; import { WysiwygAdapterComponent } from '@website/components/wysiwyg_adapter/wysiwyg_adapter'; -import { ComponentWrapper } from "web.OwlCompatibility"; +import { ComponentWrapper } from "@web/legacy/js/owl_compatibility"; import { MediaDialog } from "@web_editor/components/media_dialog/media_dialog"; import { MediaDialogWrapper } from "@web_editor/components/media_dialog/media_dialog_wrapper"; import { useWowlService } from "@web/legacy/utils"; -import {qweb, _t} from "web.core"; -import {Markup} from "web.utils"; -import Dialog from "web.Dialog"; -import "website.editor.snippets.options"; +import {qweb, _t} from "@web/legacy/js/services/core"; +import { Markup } from "@web/legacy/js/core/utils"; +import Dialog from "@web/legacy/js/core/dialog"; +import "@website/js/editor/snippets.options"; import { patch } from "@web/core/utils/patch"; const { onRendered } = owl; @@ -976,7 +976,7 @@ options.registry.ReplaceMedia.include({ }, /** * Change sequence of product page images - * + * */ async setPosition(previewMode, widgetValue, params) { this._rpc({ diff --git a/addons/website_sale/static/src/js/website_sale.js b/addons/website_sale/static/src/js/website_sale.js index b868ad0099d9d..b8fd7fb9667d3 100644 --- a/addons/website_sale/static/src/js/website_sale.js +++ b/addons/website_sale/static/src/js/website_sale.js @@ -1,19 +1,19 @@ -/** @odoo-module alias=website_sale.website_sale **/ +/** @odoo-module **/ -import core from "web.core"; -import config from "web.config"; -import publicWidget from "web.public.widget"; -import VariantMixin from "website_sale.VariantMixin"; -import wSaleUtils from "website_sale.utils"; +import core from "@web/legacy/js/services/core"; +import config from "@web/legacy/js/services/config"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import VariantMixin from "@website_sale/js/variant_mixin"; +import wSaleUtils from "@website_sale/js/website_sale_utils"; const cartHandlerMixin = wSaleUtils.cartHandlerMixin; -import "web.zoomodoo"; -import {extraMenuUpdateCallbacks} from "website.content.menu"; -import dom from "web.dom"; -import { ComponentWrapper } from "web.OwlCompatibility"; +import "@web/legacy/js/libs/zoomodoo"; +import {extraMenuUpdateCallbacks} from "@website/js/content/menu"; +import dom from "@web/legacy/js/core/dom"; +import { ComponentWrapper } from "@web/legacy/js/owl_compatibility"; import { ProductImageViewerWrapper } from "@website_sale/js/components/website_sale_image_viewer"; import { debounce, throttleForAnimation } from "@web/core/utils/timing"; -publicWidget.registry.WebsiteSale = publicWidget.Widget.extend(VariantMixin, cartHandlerMixin, { +export const WebsiteSale = publicWidget.Widget.extend(VariantMixin, cartHandlerMixin, { selector: '.oe_website_sale', events: Object.assign({}, VariantMixin.events || {}, { 'change form .js_product:first input[name="add_qty"]': '_onChangeAddQuantity', @@ -752,6 +752,8 @@ publicWidget.registry.WebsiteSale = publicWidget.Widget.extend(VariantMixin, car }, }); +publicWidget.registry.WebsiteSale = WebsiteSale + publicWidget.registry.WebsiteSaleLayout = publicWidget.Widget.extend({ selector: '.oe_website_sale', disabledInEditableMode: false, diff --git a/addons/website_sale/static/src/js/website_sale_cart.js b/addons/website_sale/static/src/js/website_sale_cart.js index d58c26e760957..d6f8f7ee2376d 100644 --- a/addons/website_sale/static/src/js/website_sale_cart.js +++ b/addons/website_sale/static/src/js/website_sale_cart.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import publicWidget from "web.public.widget"; -import core from "web.core"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import core from "@web/legacy/js/services/core"; var _t = core._t; var timeout; diff --git a/addons/website_sale/static/src/js/website_sale_category_link.js b/addons/website_sale/static/src/js/website_sale_category_link.js index 7e8a81fa3947e..a4a652a56752c 100644 --- a/addons/website_sale/static/src/js/website_sale_category_link.js +++ b/addons/website_sale/static/src/js/website_sale_category_link.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import * as publicWidget from 'web.public.widget' +import publicWidget from '@web/legacy/js/public/public_widget' publicWidget.registry.ProductCategoriesLinks = publicWidget.Widget.extend({ selector: '.o_wsale_products_page', diff --git a/addons/website_sale/static/src/js/website_sale_delivery.js b/addons/website_sale/static/src/js/website_sale_delivery.js index dd2082491b4aa..7b91a21957969 100644 --- a/addons/website_sale/static/src/js/website_sale_delivery.js +++ b/addons/website_sale/static/src/js/website_sale_delivery.js @@ -1,11 +1,11 @@ -/** @odoo-module alias=website_sale_delivery.checkout **/ +/** @odoo-module **/ -import core from "web.core"; -import publicWidget from "web.public.widget"; +import core from "@web/legacy/js/services/core"; +import publicWidget from "@web/legacy/js/public/public_widget"; const _t = core._t; const qweb = core.qweb; -import concurrency from "web.concurrency"; +import concurrency from "@web/legacy/js/core/concurrency"; publicWidget.registry.websiteSaleDelivery = publicWidget.Widget.extend({ selector: '.oe_website_sale', diff --git a/addons/website_sale/static/src/js/website_sale_form_editor.js b/addons/website_sale/static/src/js/website_sale_form_editor.js index 9cadffe6254ea..3b17a6cd85711 100644 --- a/addons/website_sale/static/src/js/website_sale_form_editor.js +++ b/addons/website_sale/static/src/js/website_sale_form_editor.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import FormEditorRegistry from "website.form_editor_registry"; +import FormEditorRegistry from "@website/js/form_editor_registry"; FormEditorRegistry.add('create_customer', { formFields: [{ diff --git a/addons/website_sale/static/src/js/website_sale_offcanvas.js b/addons/website_sale/static/src/js/website_sale_offcanvas.js index 656f6c92bacfb..36c0c95dc96b1 100644 --- a/addons/website_sale/static/src/js/website_sale_offcanvas.js +++ b/addons/website_sale/static/src/js/website_sale_offcanvas.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import publicWidget from "web.public.widget"; +import publicWidget from "@web/legacy/js/public/public_widget"; publicWidget.registry.websiteSaleOffcanvas = publicWidget.Widget.extend({ selector: '#o_wsale_offcanvas', diff --git a/addons/website_sale/static/src/js/website_sale_payment.js b/addons/website_sale/static/src/js/website_sale_payment.js index 2711453f90686..ce3eb04186c8f 100644 --- a/addons/website_sale/static/src/js/website_sale_payment.js +++ b/addons/website_sale/static/src/js/website_sale_payment.js @@ -1,8 +1,8 @@ /** @odoo-module **/ import { debounce } from "@web/core/utils/timing"; -import checkoutForm from "payment.checkout_form"; - import publicWidget from "web.public.widget"; +import checkoutForm from "@payment/js/checkout_form"; + import publicWidget from "@web/legacy/js/public/public_widget"; const websiteSalePaymentMixin = { @@ -56,7 +56,7 @@ import checkoutForm from "payment.checkout_form"; /** * Verify that the Terms and Condition checkbox is checked. * - * @override method from payment.payment_form_mixin + * @override method from @payment/js/payment_form_mixin * @private * @return {boolean} Whether the submit button can be enabled */ diff --git a/addons/website_sale/static/src/js/website_sale_price_range_option.js b/addons/website_sale/static/src/js/website_sale_price_range_option.js index cbea63c7b08bc..d2fb6bd5699e5 100644 --- a/addons/website_sale/static/src/js/website_sale_price_range_option.js +++ b/addons/website_sale/static/src/js/website_sale_price_range_option.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import publicWidget from "web.public.widget"; +import publicWidget from "@web/legacy/js/public/public_widget"; publicWidget.registry.multirangePriceSelector = publicWidget.Widget.extend({ selector: '.o_wsale_products_page', diff --git a/addons/website_sale/static/src/js/website_sale_recently_viewed.js b/addons/website_sale/static/src/js/website_sale_recently_viewed.js index 37cddd3376a1c..5a933c3c45a79 100644 --- a/addons/website_sale/static/src/js/website_sale_recently_viewed.js +++ b/addons/website_sale/static/src/js/website_sale_recently_viewed.js @@ -1,8 +1,8 @@ /** @odoo-module **/ import { debounce } from "@web/core/utils/timing"; -import publicWidget from "web.public.widget"; -import {getCookie, setCookie} from "web.utils.cookies"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import {getCookie, setCookie} from "@web/legacy/js/core/cookie_utils"; publicWidget.registry.productsRecentlyViewedUpdate = publicWidget.Widget.extend({ selector: '#product_detail', diff --git a/addons/website_sale/static/src/js/website_sale_reorder.js b/addons/website_sale/static/src/js/website_sale_reorder.js index cac5e1468e4b5..405dbc4864b3a 100644 --- a/addons/website_sale/static/src/js/website_sale_reorder.js +++ b/addons/website_sale/static/src/js/website_sale_reorder.js @@ -1,9 +1,9 @@ /** @odoo-module **/ import { debounce as debounceFn } from "@web/core/utils/timing"; -import publicWidget from "web.public.widget"; +import publicWidget from "@web/legacy/js/public/public_widget"; import { localization as l10n } from "@web/core/l10n/localization"; -import { ComponentWrapper } from "web.OwlCompatibility"; +import { ComponentWrapper } from "@web/legacy/js/owl_compatibility"; import { intersperse, nbsp } from "@web/core/utils/strings"; import { ConfirmationDialog } from "@web/core/confirmation_dialog/confirmation_dialog"; diff --git a/addons/website_sale/static/src/js/website_sale_tracking.js b/addons/website_sale/static/src/js/website_sale_tracking.js index beb11e48fe2a4..9421e7b86b618 100644 --- a/addons/website_sale/static/src/js/website_sale_tracking.js +++ b/addons/website_sale/static/src/js/website_sale_tracking.js @@ -1,6 +1,6 @@ -/** @odoo-module alias=website_sale.tracking **/ +/** @odoo-module **/ -import publicWidget from "web.public.widget"; +import publicWidget from "@web/legacy/js/public/public_widget"; publicWidget.registry.websiteSaleTracking = publicWidget.Widget.extend({ selector: '.oe_website_sale', diff --git a/addons/website_sale/static/src/js/website_sale_utils.js b/addons/website_sale/static/src/js/website_sale_utils.js index 0d95f55734feb..b035f23098209 100644 --- a/addons/website_sale/static/src/js/website_sale_utils.js +++ b/addons/website_sale/static/src/js/website_sale_utils.js @@ -1,8 +1,8 @@ -/** @odoo-module alias=website_sale.utils **/ +/** @odoo-module **/ -import wUtils from "website.utils"; +import wUtils from "@website/js/utils"; -const cartHandlerMixin = { +export const cartHandlerMixin = { getRedirectOption() { const html = document.documentElement; this.stayOnPageOption = html.dataset.add2cartRedirect === '1'; diff --git a/addons/website_sale/static/src/js/website_sale_validate.js b/addons/website_sale/static/src/js/website_sale_validate.js index c7f37d89bf58e..57a2afa19c4a5 100644 --- a/addons/website_sale/static/src/js/website_sale_validate.js +++ b/addons/website_sale/static/src/js/website_sale_validate.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import publicWidget from "web.public.widget"; -import core from "web.core"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import core from "@web/legacy/js/services/core"; var _t = core._t; publicWidget.registry.websiteSaleValidate = publicWidget.Widget.extend({ diff --git a/addons/website_sale/static/src/snippets/s_add_to_cart/000.js b/addons/website_sale/static/src/snippets/s_add_to_cart/000.js index 487393a4a98a3..14bb419fabfb6 100644 --- a/addons/website_sale/static/src/snippets/s_add_to_cart/000.js +++ b/addons/website_sale/static/src/snippets/s_add_to_cart/000.js @@ -1,9 +1,9 @@ /** @odoo-module **/ -import publicWidget from 'web.public.widget'; -import { cartHandlerMixin } from 'website_sale.utils'; -import { WebsiteSale } from 'website_sale.website_sale'; -import { _t } from 'web.core'; +import publicWidget from '@web/legacy/js/public/public_widget'; +import { cartHandlerMixin } from '@website_sale/js/website_sale_utils'; +import { WebsiteSale } from '@website_sale/js/website_sale'; +import { _t } from "@web/legacy/js/services/core"; publicWidget.registry.AddToCartSnippet = WebsiteSale.extend(cartHandlerMixin, { selector: '.s_add_to_cart_btn', diff --git a/addons/website_sale/static/src/snippets/s_add_to_cart/options.js b/addons/website_sale/static/src/snippets/s_add_to_cart/options.js index a65993dff8967..37008dc0d0e7b 100644 --- a/addons/website_sale/static/src/snippets/s_add_to_cart/options.js +++ b/addons/website_sale/static/src/snippets/s_add_to_cart/options.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import options from 'web_editor.snippets.options'; -import { _t } from 'web.core'; +import options from '@web_editor/js/editor/snippets.options'; +import { _t } from "@web/legacy/js/services/core"; const Many2oneUserValueWidget = options.userValueWidgetsRegistry['we-many2one']; diff --git a/addons/website_sale/static/src/snippets/s_dynamic_snippet_products/000.js b/addons/website_sale/static/src/snippets/s_dynamic_snippet_products/000.js index a3943dc49c5ff..bf7c786de4e2b 100644 --- a/addons/website_sale/static/src/snippets/s_dynamic_snippet_products/000.js +++ b/addons/website_sale/static/src/snippets/s_dynamic_snippet_products/000.js @@ -1,8 +1,8 @@ -/** @odoo-module alias=website_sale.s_dynamic_snippet_products **/ +/** @odoo-module **/ -import publicWidget from "web.public.widget"; -import DynamicSnippetCarousel from "website.s_dynamic_snippet_carousel"; -import wSaleUtils from "website_sale.utils"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import DynamicSnippetCarousel from "@website/snippets/s_dynamic_snippet_carousel/000"; +import wSaleUtils from "@website_sale/js/website_sale_utils"; const DynamicSnippetProducts = DynamicSnippetCarousel.extend({ selector: '.s_dynamic_snippet_products', @@ -127,8 +127,8 @@ const DynamicSnippetProductsCard = publicWidget.Widget.extend({ /** * Event triggered by a click on the Add to cart button - * - * @param {OdooEvent} ev + * + * @param {OdooEvent} ev */ async _onClickAddToCart(ev) { const $card = $(ev.currentTarget).closest('.card'); diff --git a/addons/website_sale/static/src/snippets/s_dynamic_snippet_products/options.js b/addons/website_sale/static/src/snippets/s_dynamic_snippet_products/options.js index a8cec2ae4eb2b..a488b2eee4c8a 100644 --- a/addons/website_sale/static/src/snippets/s_dynamic_snippet_products/options.js +++ b/addons/website_sale/static/src/snippets/s_dynamic_snippet_products/options.js @@ -1,9 +1,9 @@ -/** @odoo-module alias=website_sale.s_dynamic_snippet_products_options **/ +/** @odoo-module **/ -import options from "web_editor.snippets.options"; -import s_dynamic_snippet_carousel_options from "website.s_dynamic_snippet_carousel_options"; +import options from "@web_editor/js/editor/snippets.options"; +import s_dynamic_snippet_carousel_options from "@website/snippets/s_dynamic_snippet_carousel/options"; -import wUtils from "website.utils"; +import wUtils from "@website/js/utils"; const alternativeSnippetRemovedOptions = [ 'filter_opt', 'product_category_opt', 'product_tag_opt', 'product_names_opt', diff --git a/addons/website_sale/static/src/snippets/s_popup/000.js b/addons/website_sale/static/src/snippets/s_popup/000.js index 557c7bd9da686..5934f35235aca 100644 --- a/addons/website_sale/static/src/snippets/s_popup/000.js +++ b/addons/website_sale/static/src/snippets/s_popup/000.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import PopupWidget from 'website.s_popup'; +import PopupWidget from '@website/snippets/s_popup/000'; PopupWidget.include({ diff --git a/addons/website_sale/static/tests/tours/website_free_delivery.js b/addons/website_sale/static/tests/tours/website_free_delivery.js index 4fcf1e15b7982..4a9abdafe9f0c 100644 --- a/addons/website_sale/static/tests/tours/website_free_delivery.js +++ b/addons/website_sale/static/tests/tours/website_free_delivery.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { registry } from "@web/core/registry"; -import tourUtils from "website_sale.tour_utils"; +import tourUtils from "@website_sale/js/tours/tour_utils"; registry.category("web_tour.tours").add('check_free_delivery', { test: true, diff --git a/addons/website_sale/static/tests/tours/website_sale_add_to_cart_snippet_tour.js b/addons/website_sale/static/tests/tours/website_sale_add_to_cart_snippet_tour.js index 0a55c7e115d9c..fbcc433bee485 100644 --- a/addons/website_sale/static/tests/tours/website_sale_add_to_cart_snippet_tour.js +++ b/addons/website_sale/static/tests/tours/website_sale_add_to_cart_snippet_tour.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import wsTourUtils from 'website_sale.tour_utils'; -import wTourUtils from 'website.tour_utils'; +import wsTourUtils from '@website_sale/js/tours/tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; function editAddToCartSnippet() { return [ diff --git a/addons/website_sale/static/tests/tours/website_sale_buy.js b/addons/website_sale/static/tests/tours/website_sale_buy.js index b2c6729a3451e..18a163f347a0e 100644 --- a/addons/website_sale/static/tests/tours/website_sale_buy.js +++ b/addons/website_sale/static/tests/tours/website_sale_buy.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=website_sale.tour **/ +/** @odoo-module **/ import { registry } from "@web/core/registry"; -import tourUtils from "website_sale.tour_utils"; +import tourUtils from "@website_sale/js/tours/tour_utils"; registry.category("web_tour.tours").add('shop_buy_product', { test: true, diff --git a/addons/website_sale/static/tests/tours/website_sale_cart_popover.js b/addons/website_sale/static/tests/tours/website_sale_cart_popover.js index 9587c6612f329..086a60850ff15 100644 --- a/addons/website_sale/static/tests/tours/website_sale_cart_popover.js +++ b/addons/website_sale/static/tests/tours/website_sale_cart_popover.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { registry } from "@web/core/registry"; -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; registry.category("web_tour.tours").add('website_sale_cart_popover_tour', { test: true, diff --git a/addons/website_sale/static/tests/tours/website_sale_category_page_and_products_snippet.js b/addons/website_sale/static/tests/tours/website_sale_category_page_and_products_snippet.js index 3ba380bc86acb..47da2126e143f 100644 --- a/addons/website_sale/static/tests/tours/website_sale_category_page_and_products_snippet.js +++ b/addons/website_sale/static/tests/tours/website_sale_category_page_and_products_snippet.js @@ -1,6 +1,6 @@ /** @odoo-modules */ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; import { registry } from "@web/core/registry"; const PRODUCT_CATEGORY_ID = 2; diff --git a/addons/website_sale/static/tests/tours/website_sale_complete_flow.js b/addons/website_sale/static/tests/tours/website_sale_complete_flow.js index 12787e6a20a8f..9dc155ceeb374 100644 --- a/addons/website_sale/static/tests/tours/website_sale_complete_flow.js +++ b/addons/website_sale/static/tests/tours/website_sale_complete_flow.js @@ -1,8 +1,8 @@ /** @odoo-module **/ - + import { registry } from "@web/core/registry"; - import rpc from "web.rpc"; - import tourUtils from "website_sale.tour_utils"; + import rpc from "@web/legacy/js/core/rpc"; + import tourUtils from "@website_sale/js/tours/tour_utils"; registry.category("web_tour.tours").add('website_sale_tour_1', { test: true, diff --git a/addons/website_sale/static/tests/tours/website_sale_complete_flow_backend.js b/addons/website_sale/static/tests/tours/website_sale_complete_flow_backend.js index 04f22309ec80a..0c40f7961a2ef 100644 --- a/addons/website_sale/static/tests/tours/website_sale_complete_flow_backend.js +++ b/addons/website_sale/static/tests/tours/website_sale_complete_flow_backend.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; wTourUtils.registerWebsitePreviewTour('website_sale_tour_backend', { test: true, diff --git a/addons/website_sale/static/tests/tours/website_sale_google_analytics.js b/addons/website_sale/static/tests/tours/website_sale_google_analytics.js index a51dfa72500b7..460277bc16370 100644 --- a/addons/website_sale/static/tests/tours/website_sale_google_analytics.js +++ b/addons/website_sale/static/tests/tours/website_sale_google_analytics.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { registry } from "@web/core/registry"; -import websiteSaleTracking from "website_sale.tracking"; +import websiteSaleTracking from "@website_sale/js/website_sale_tracking"; let itemId; diff --git a/addons/website_sale/static/tests/tours/website_sale_reorder_from_portal.js b/addons/website_sale/static/tests/tours/website_sale_reorder_from_portal.js index 755bcfc1a3476..4196d8fc1f1c5 100644 --- a/addons/website_sale/static/tests/tours/website_sale_reorder_from_portal.js +++ b/addons/website_sale/static/tests/tours/website_sale_reorder_from_portal.js @@ -1,8 +1,8 @@ /** @odoo-module **/ import { registry } from "@web/core/registry"; -import wsTourUtils from 'website_sale.tour_utils'; -import wTourUtils from 'website.tour_utils'; +import wsTourUtils from '@website_sale/js/tours/tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; registry.category("web_tour.tours").add('website_sale_reorder_from_portal', { test: true, diff --git a/addons/website_sale/static/tests/tours/website_sale_restricted_editor_ui.js b/addons/website_sale/static/tests/tours/website_sale_restricted_editor_ui.js index ee1effa40a783..68427dbec313e 100644 --- a/addons/website_sale/static/tests/tours/website_sale_restricted_editor_ui.js +++ b/addons/website_sale/static/tests/tours/website_sale_restricted_editor_ui.js @@ -1,6 +1,6 @@ /** @odoo-modules */ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; wTourUtils.registerWebsitePreviewTour('website_sale_restricted_editor_ui', { test: true, diff --git a/addons/website_sale/static/tests/tours/website_sale_shop_cart_recovery.js b/addons/website_sale/static/tests/tours/website_sale_shop_cart_recovery.js index 32a45701f55c0..d847b23a1dad4 100644 --- a/addons/website_sale/static/tests/tours/website_sale_shop_cart_recovery.js +++ b/addons/website_sale/static/tests/tours/website_sale_shop_cart_recovery.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import localStorage from "web.local_storage"; +import localStorage from "@web/legacy/js/core/local_storage"; import { registry } from "@web/core/registry"; -import tourUtils from "website_sale.tour_utils"; +import tourUtils from "@website_sale/js/tours/tour_utils"; var orderIdKey = 'website_sale.tour_shop_cart_recovery.orderId'; var recoveryLinkKey = 'website_sale.tour_shop_cart_recovery.recoveryLink'; diff --git a/addons/website_sale/static/tests/tours/website_sale_shop_compare_list_price_pricelist.js b/addons/website_sale/static/tests/tours/website_sale_shop_compare_list_price_pricelist.js index 45fac825fa623..4b5ab4f5650eb 100644 --- a/addons/website_sale/static/tests/tours/website_sale_shop_compare_list_price_pricelist.js +++ b/addons/website_sale/static/tests/tours/website_sale_shop_compare_list_price_pricelist.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { registry } from "@web/core/registry"; -import tourUtils from 'website_sale.tour_utils'; +import tourUtils from '@website_sale/js/tours/tour_utils'; registry.category("web_tour.tours").add('compare_list_price_price_list_display', { test: true, diff --git a/addons/website_sale/static/tests/tours/website_sale_shop_custom_attribute_value.js b/addons/website_sale/static/tests/tours/website_sale_shop_custom_attribute_value.js index 8f1c3d837842d..ef95ca9a3a261 100644 --- a/addons/website_sale/static/tests/tours/website_sale_shop_custom_attribute_value.js +++ b/addons/website_sale/static/tests/tours/website_sale_shop_custom_attribute_value.js @@ -1,7 +1,7 @@ /** @odoo-module **/ - + import { registry } from "@web/core/registry"; - import tourUtils from "website_sale.tour_utils"; + import tourUtils from "@website_sale/js/tours/tour_utils"; registry.category("web_tour.tours").add("shop_custom_attribute_value", { url: "/shop?search=Customizable Desk", diff --git a/addons/website_sale/static/tests/tours/website_sale_shop_customize.js b/addons/website_sale/static/tests/tours/website_sale_shop_customize.js index 3ce50bbb6a8c2..40540b37b7e3f 100644 --- a/addons/website_sale/static/tests/tours/website_sale_shop_customize.js +++ b/addons/website_sale/static/tests/tours/website_sale_shop_customize.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import tourUtils from 'website_sale.tour_utils'; -import wTourUtils from 'website.tour_utils'; +import tourUtils from '@website_sale/js/tours/tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; wTourUtils.registerWebsitePreviewTour('shop_customize', { url: '/shop', diff --git a/addons/website_sale/static/tests/tours/website_sale_shop_dynamic_variants.js b/addons/website_sale/static/tests/tours/website_sale_shop_dynamic_variants.js index b64e07276f930..fdfc500d8a97d 100644 --- a/addons/website_sale/static/tests/tours/website_sale_shop_dynamic_variants.js +++ b/addons/website_sale/static/tests/tours/website_sale_shop_dynamic_variants.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { registry } from "@web/core/registry"; -import tourUtils from "website_sale.tour_utils"; +import tourUtils from "@website_sale/js/tours/tour_utils"; // This tour relies on a data created from the python test. registry.category("web_tour.tours").add('tour_shop_dynamic_variants', { diff --git a/addons/website_sale/static/tests/tours/website_sale_shop_editor_tour.js b/addons/website_sale/static/tests/tours/website_sale_shop_editor_tour.js index e7c3278cb0338..6f9d97ff793ac 100644 --- a/addons/website_sale/static/tests/tours/website_sale_shop_editor_tour.js +++ b/addons/website_sale/static/tests/tours/website_sale_shop_editor_tour.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from "website.tour_utils"; +import wTourUtils from "@website/js/tours/tour_utils"; wTourUtils.registerWebsitePreviewTour("shop_editor", { test: true, diff --git a/addons/website_sale/static/tests/tours/website_sale_shop_list_view_b2c.js b/addons/website_sale/static/tests/tours/website_sale_shop_list_view_b2c.js index a912d8362b6a6..30820b01fd1ee 100644 --- a/addons/website_sale/static/tests/tours/website_sale_shop_list_view_b2c.js +++ b/addons/website_sale/static/tests/tours/website_sale_shop_list_view_b2c.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import tourUtils from 'website_sale.tour_utils'; -import wTourUtils from 'website.tour_utils'; +import tourUtils from '@website_sale/js/tours/tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; wTourUtils.registerWebsitePreviewTour('shop_list_view_b2c', { test: true, diff --git a/addons/website_sale/static/tests/tours/website_sale_shop_mail.js b/addons/website_sale/static/tests/tours/website_sale_shop_mail.js index 6d03ff722ac91..8be4fc6b5aebb 100644 --- a/addons/website_sale/static/tests/tours/website_sale_shop_mail.js +++ b/addons/website_sale/static/tests/tours/website_sale_shop_mail.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import rpc from "web.rpc"; +import rpc from "@web/legacy/js/core/rpc"; import { registry } from "@web/core/registry"; -import tourUtils from "website_sale.tour_utils"; +import tourUtils from "@website_sale/js/tours/tour_utils"; registry.category("web_tour.tours").add('shop_mail', { test: true, diff --git a/addons/website_sale/static/tests/tours/website_sale_shop_no_variant_attribute.js b/addons/website_sale/static/tests/tours/website_sale_shop_no_variant_attribute.js index 849dc9e7d4481..812567f403836 100644 --- a/addons/website_sale/static/tests/tours/website_sale_shop_no_variant_attribute.js +++ b/addons/website_sale/static/tests/tours/website_sale_shop_no_variant_attribute.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { registry } from "@web/core/registry"; -import tourUtils from "website_sale.tour_utils"; +import tourUtils from "@website_sale/js/tours/tour_utils"; // This tour relies on a data created from the python test. registry.category("web_tour.tours").add('tour_shop_no_variant_attribute', { diff --git a/addons/website_sale/static/tests/tours/website_sale_snippet_products.js b/addons/website_sale/static/tests/tours/website_sale_snippet_products.js index d2c878c56c506..a9ed98cb890a5 100644 --- a/addons/website_sale/static/tests/tours/website_sale_snippet_products.js +++ b/addons/website_sale/static/tests/tours/website_sale_snippet_products.js @@ -1,7 +1,7 @@ /** @odoo-module */ -import wTourUtils from 'website.tour_utils'; -import wSaleTourUtils from 'website_sale.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; +import wSaleTourUtils from '@website_sale/js/tours/tour_utils'; const optionBlock = 'dynamic_snippet_products'; const productsSnippet = {id: 's_dynamic_snippet_products', name: 'Products'}; diff --git a/addons/website_sale_autocomplete/static/src/js/address_form.js b/addons/website_sale_autocomplete/static/src/js/address_form.js index 9ff007a9f6fbe..23dbf35726a9e 100644 --- a/addons/website_sale_autocomplete/static/src/js/address_form.js +++ b/addons/website_sale_autocomplete/static/src/js/address_form.js @@ -1,9 +1,9 @@ /** @odoo-module */ -import publicWidget from 'web.public.widget'; -import { DropPrevious } from 'web.concurrency'; +import publicWidget from '@web/legacy/js/public/public_widget'; +import { DropPrevious } from '@web/legacy/js/core/concurrency'; import { debounce } from "@web/core/utils/timing"; -import { qweb as QWeb } from 'web.core'; +import { qweb as QWeb } from "@web/legacy/js/services/core"; publicWidget.registry.AddressForm = publicWidget.Widget.extend({ selector: '.oe_cart .checkout_autoformat:has(input[name="street"][data-autocomplete-enabled="1"])', diff --git a/addons/website_sale_autocomplete/static/tests/autocomplete_tour.js b/addons/website_sale_autocomplete/static/tests/autocomplete_tour.js index 46cc48f1d154c..316edf7f18679 100644 --- a/addons/website_sale_autocomplete/static/tests/autocomplete_tour.js +++ b/addons/website_sale_autocomplete/static/tests/autocomplete_tour.js @@ -2,7 +2,7 @@ import { registry } from "@web/core/registry"; import { TourError } from "@web_tour/tour_service/tour_utils"; -import tourUtils from 'website_sale.tour_utils'; +import tourUtils from '@website_sale/js/tours/tour_utils'; function fail (errorMessage) { diff --git a/addons/website_sale_comparison/static/src/js/website_sale.js b/addons/website_sale_comparison/static/src/js/website_sale.js index 51fbcb8308f44..f1871af046462 100644 --- a/addons/website_sale_comparison/static/src/js/website_sale.js +++ b/addons/website_sale_comparison/static/src/js/website_sale.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import { WebsiteSale } from 'website_sale.website_sale'; +import { WebsiteSale } from '@website_sale/js/website_sale'; WebsiteSale.include({ /** diff --git a/addons/website_sale_comparison/static/src/js/website_sale_comparison.js b/addons/website_sale_comparison/static/src/js/website_sale_comparison.js index 55986d2371687..8fd22e2d9c449 100644 --- a/addons/website_sale_comparison/static/src/js/website_sale_comparison.js +++ b/addons/website_sale_comparison/static/src/js/website_sale_comparison.js @@ -1,11 +1,11 @@ -/** @odoo-module alias=website_sale_comparison.comparison **/ +/** @odoo-module **/ -import concurrency from "web.concurrency"; -import core from "web.core"; -import publicWidget from "web.public.widget"; -import {getCookie, setCookie} from "web.utils.cookies"; -import VariantMixin from "website_sale.SaleVariantMixin"; -import website_sale_utils from "website_sale.utils"; +import concurrency from "@web/legacy/js/core/concurrency"; +import core from "@web/legacy/js/services/core"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import {getCookie, setCookie} from "@web/legacy/js/core/cookie_utils"; +import VariantMixin from "@website_sale/js/sale_variant_mixin"; +import website_sale_utils from "@website_sale/js/website_sale_utils"; const cartHandlerMixin = website_sale_utils.cartHandlerMixin; var qweb = core.qweb; diff --git a/addons/website_sale_comparison/static/tests/tours/website_sale_comparison.js b/addons/website_sale_comparison/static/tests/tours/website_sale_comparison.js index 4062a714f8035..8d026e70da868 100644 --- a/addons/website_sale_comparison/static/tests/tours/website_sale_comparison.js +++ b/addons/website_sale_comparison/static/tests/tours/website_sale_comparison.js @@ -1,7 +1,7 @@ /** @odoo-module **/ - + import { registry } from "@web/core/registry"; - import tourUtils from "website_sale.tour_utils"; + import tourUtils from "@website_sale/js/tours/tour_utils"; registry.category("web_tour.tours").add('product_comparison', { test: true, diff --git a/addons/website_sale_comparison_wishlist/static/src/js/wishlist.js b/addons/website_sale_comparison_wishlist/static/src/js/wishlist.js index 1bedc2eafb6c1..a198e4b526fa0 100644 --- a/addons/website_sale_comparison_wishlist/static/src/js/wishlist.js +++ b/addons/website_sale_comparison_wishlist/static/src/js/wishlist.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import publicWidget from 'web.public.widget'; -import 'website_sale_comparison.comparison'; +import publicWidget from '@web/legacy/js/public/public_widget'; +import '@website_sale_comparison/js/website_sale_comparison'; publicWidget.registry.ProductComparison.include({ events: Object.assign({}, publicWidget.registry.ProductComparison.prototype.events, { diff --git a/addons/website_sale_loyalty/static/src/js/coupon_toaster_widget.js b/addons/website_sale_loyalty/static/src/js/coupon_toaster_widget.js index 08c2c2ede92db..996abaf6b09b3 100644 --- a/addons/website_sale_loyalty/static/src/js/coupon_toaster_widget.js +++ b/addons/website_sale_loyalty/static/src/js/coupon_toaster_widget.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import publicWidget from 'web.public.widget'; +import publicWidget from '@web/legacy/js/public/public_widget'; import {registry} from "@web/core/registry"; const CouponToasterWidget = publicWidget.Widget.extend({ diff --git a/addons/website_sale_loyalty/static/src/js/website_sale_gift_card.js b/addons/website_sale_loyalty/static/src/js/website_sale_gift_card.js index ebb83464cb798..eab88ab664f27 100644 --- a/addons/website_sale_loyalty/static/src/js/website_sale_gift_card.js +++ b/addons/website_sale_loyalty/static/src/js/website_sale_gift_card.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import publicWidget from 'web.public.widget'; +import publicWidget from '@web/legacy/js/public/public_widget'; publicWidget.registry.WebsiteSaleGiftCardCopy = publicWidget.Widget.extend({ selector: '.o_purchased_gift_card', diff --git a/addons/website_sale_loyalty/static/src/js/website_sale_loyalty_delivery.js b/addons/website_sale_loyalty/static/src/js/website_sale_loyalty_delivery.js index af98f0b584642..f07dbc8829e77 100644 --- a/addons/website_sale_loyalty/static/src/js/website_sale_loyalty_delivery.js +++ b/addons/website_sale_loyalty/static/src/js/website_sale_loyalty_delivery.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import PublicWidget from 'web.public.widget'; -import { patch } from 'web.utils'; -import core from 'web.core'; +import PublicWidget from '@web/legacy/js/public/public_widget'; +import { patch } from '@web/legacy/js/core/utils'; +import core from "@web/legacy/js/services/core"; const _t = core._t; diff --git a/addons/website_sale_loyalty/static/tests/tours/test_gift_card_tour.js b/addons/website_sale_loyalty/static/tests/tours/test_gift_card_tour.js index f487f56edb9c4..593bd37eabd9d 100644 --- a/addons/website_sale_loyalty/static/tests/tours/test_gift_card_tour.js +++ b/addons/website_sale_loyalty/static/tests/tours/test_gift_card_tour.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { registry } from "@web/core/registry"; -import tourUtils from 'website_sale.tour_utils'; +import tourUtils from '@website_sale/js/tours/tour_utils'; registry.category("web_tour.tours").add('shop_sale_gift_card', { test: true, diff --git a/addons/website_sale_loyalty/static/tests/tours/test_promo_main_tour.js b/addons/website_sale_loyalty/static/tests/tours/test_promo_main_tour.js index f8e7ccf12a57c..c2a2534c7e48b 100644 --- a/addons/website_sale_loyalty/static/tests/tours/test_promo_main_tour.js +++ b/addons/website_sale_loyalty/static/tests/tours/test_promo_main_tour.js @@ -1,8 +1,8 @@ /** @odoo-module **/ import { registry } from "@web/core/registry"; -import ajax from 'web.ajax'; -import tourUtils from 'website_sale.tour_utils'; +import ajax from '@web/legacy/js/core/ajax'; +import tourUtils from '@website_sale/js/tours/tour_utils'; registry.category("web_tour.tours").add('shop_sale_loyalty', { test: true, diff --git a/addons/website_sale_loyalty/static/tests/tours/website_sale_delivery_gift_card.js b/addons/website_sale_loyalty/static/tests/tours/website_sale_delivery_gift_card.js index f1b35fe8b5ffd..f1c0613e61204 100644 --- a/addons/website_sale_loyalty/static/tests/tours/website_sale_delivery_gift_card.js +++ b/addons/website_sale_loyalty/static/tests/tours/website_sale_delivery_gift_card.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=website_sale_loyalty_giftcard.test **/ +/** @odoo-module **/ import { registry } from "@web/core/registry"; -import wsTourUtils from "website_sale.tour_utils"; +import wsTourUtils from "@website_sale/js/tours/tour_utils"; registry.category("web_tour.tours").add('shop_sale_loyalty_delivery', { test: true, diff --git a/addons/website_sale_mondialrelay/static/src/js/website_sale_mondialrelay.js b/addons/website_sale_mondialrelay/static/src/js/website_sale_mondialrelay.js index 2e02d64ea2901..7c99d07aa0c00 100644 --- a/addons/website_sale_mondialrelay/static/src/js/website_sale_mondialrelay.js +++ b/addons/website_sale_mondialrelay/static/src/js/website_sale_mondialrelay.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import publicWidget from "web.public.widget"; -import "website_sale_delivery.checkout"; -import {qweb as QWeb} from "web.core"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import "@website_sale/js/website_sale_delivery"; +import {qweb as QWeb} from "@web/legacy/js/services/core"; const WebsiteSaleDeliveryWidget = publicWidget.registry.websiteSaleDelivery; diff --git a/addons/website_sale_picking/static/src/js/checkout_form.js b/addons/website_sale_picking/static/src/js/checkout_form.js index 997b226853ff8..5e18eba6611a0 100644 --- a/addons/website_sale_picking/static/src/js/checkout_form.js +++ b/addons/website_sale_picking/static/src/js/checkout_form.js @@ -1,8 +1,8 @@ /** @odoo-module */ -import publicWidget from 'web.public.widget'; -import { _t } from 'web.core'; -import 'website_sale_delivery.checkout'; +import publicWidget from '@web/legacy/js/public/public_widget'; +import { _t } from "@web/legacy/js/services/core"; +import '@website_sale/js/website_sale_delivery'; publicWidget.registry.websiteSaleDelivery.include({ start: function () { diff --git a/addons/website_sale_picking/static/tests/tours/onsite_payment_tour.js b/addons/website_sale_picking/static/tests/tours/onsite_payment_tour.js index b0e5f7d1184f0..497ec020c2ddd 100644 --- a/addons/website_sale_picking/static/tests/tours/onsite_payment_tour.js +++ b/addons/website_sale_picking/static/tests/tours/onsite_payment_tour.js @@ -1,8 +1,8 @@ /** @odoo-module */ import { registry } from "@web/core/registry"; -import wTourUtils from 'website.tour_utils'; -import wsTourUtils from 'website_sale.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; +import wsTourUtils from '@website_sale/js/tours/tour_utils'; registry.category("web_tour.tours").add('onsite_payment_tour', { test: true, diff --git a/addons/website_sale_product_configurator/static/src/js/sale_product_configurator_modal.js b/addons/website_sale_product_configurator/static/src/js/sale_product_configurator_modal.js index 9b944b63c720a..7ef1b36a9fdc0 100644 --- a/addons/website_sale_product_configurator/static/src/js/sale_product_configurator_modal.js +++ b/addons/website_sale_product_configurator/static/src/js/sale_product_configurator_modal.js @@ -1,10 +1,10 @@ /** @odoo-module */ -import ajax from 'web.ajax'; -import Dialog from 'web.Dialog'; -import OwlDialog from 'web.OwlDialog'; -import ServicesMixin from 'web.ServicesMixin'; -import VariantMixin from 'website_sale.SaleVariantMixin'; +import ajax from '@web/legacy/js/core/ajax'; +import Dialog from '@web/legacy/js/core/dialog'; +import OwlDialog from '@web/legacy/js/core/owl_dialog'; +import ServicesMixin from '@web/legacy/js/core/service_mixins'; +import VariantMixin from '@website_sale/js/sale_variant_mixin'; import { uniqueId } from '@web/core/utils/functions'; export const OptionalProductsModal = Dialog.extend(ServicesMixin, VariantMixin, { diff --git a/addons/website_sale_product_configurator/static/src/js/website_sale_options.js b/addons/website_sale_product_configurator/static/src/js/website_sale_options.js index 17bd20a212c21..dabfabda3a937 100644 --- a/addons/website_sale_product_configurator/static/src/js/website_sale_options.js +++ b/addons/website_sale_product_configurator/static/src/js/website_sale_options.js @@ -1,11 +1,11 @@ -/** @odoo-module alias=website_sale_options.website_sale **/ +/** @odoo-module **/ -import ajax from "web.ajax"; -import core from "web.core"; -import publicWidget from "web.public.widget"; +import ajax from "@web/legacy/js/core/ajax"; +import core from "@web/legacy/js/services/core"; +import publicWidget from "@web/legacy/js/public/public_widget"; import { OptionalProductsModal } from "@website_sale_product_configurator/js/sale_product_configurator_modal"; -import "website_sale.website_sale"; -import wsUtils from "website_sale.utils"; +import "@website_sale/js/website_sale"; +import wsUtils from "@website_sale/js/website_sale_utils"; var _t = core._t; diff --git a/addons/website_sale_product_configurator/static/tests/tours/website_sale_buy.js b/addons/website_sale_product_configurator/static/tests/tours/website_sale_buy.js index 48cd291cc094d..cbf70869879c0 100644 --- a/addons/website_sale_product_configurator/static/tests/tours/website_sale_buy.js +++ b/addons/website_sale_product_configurator/static/tests/tours/website_sale_buy.js @@ -5,7 +5,7 @@ */ import { registry } from "@web/core/registry"; import { patch } from "@web/core/utils/patch"; -import "website_sale.tour"; +import "@website_sale/../tests/tours/website_sale_buy"; patch(registry.category("web_tour.tours").get("shop_buy_product"), "patch_shop_buy_product", { steps() { @@ -15,6 +15,6 @@ patch(registry.category("web_tour.tours").get("shop_buy_product"), "patch_shop_b content: "click in modal on 'Proceed to checkout' button", trigger: 'button:contains("Proceed to Checkout")', }); - return originalSteps; + return originalSteps; }, }); diff --git a/addons/website_sale_slides/static/src/js/slides_course_join.js b/addons/website_sale_slides/static/src/js/slides_course_join.js index 4c20e51da8974..38ce06b033368 100644 --- a/addons/website_sale_slides/static/src/js/slides_course_join.js +++ b/addons/website_sale_slides/static/src/js/slides_course_join.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=website_sale_slides.course.join.widget **/ +/** @odoo-module **/ import CourseJoin from "@website_slides/js/slides_course_join"; -import wUtils from "website.utils"; +import wUtils from "@website/js/utils"; const CourseJoinWidget = CourseJoin.courseJoinWidget; diff --git a/addons/website_sale_stock/static/src/js/tours/website_sale_stock_reorder_from_portal.js b/addons/website_sale_stock/static/src/js/tours/website_sale_stock_reorder_from_portal.js index 0ac28fd1ecc43..62534e17c2931 100644 --- a/addons/website_sale_stock/static/src/js/tours/website_sale_stock_reorder_from_portal.js +++ b/addons/website_sale_stock/static/src/js/tours/website_sale_stock_reorder_from_portal.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { registry } from "@web/core/registry"; -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; registry.category("web_tour.tours").add('website_sale_stock_reorder_from_portal', { test: true, diff --git a/addons/website_sale_stock/static/src/js/variant_mixin.js b/addons/website_sale_stock/static/src/js/variant_mixin.js index 672a211acf39f..c865ab920331e 100644 --- a/addons/website_sale_stock/static/src/js/variant_mixin.js +++ b/addons/website_sale_stock/static/src/js/variant_mixin.js @@ -1,12 +1,12 @@ -/** @odoo-module alias=website_sale_stock.VariantMixin **/ +/** @odoo-module **/ -import {Markup} from "web.utils"; -import VariantMixin from "website_sale.SaleVariantMixin"; -import publicWidget from "web.public.widget"; -import core from "web.core"; +import { Markup } from "@web/legacy/js/core/utils"; +import VariantMixin from "@website_sale/js/sale_variant_mixin"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import core from "@web/legacy/js/services/core"; var QWeb = core.qweb; -import "website_sale.website_sale"; +import "@website_sale/js/website_sale"; /** * Addition to the variant_mixin._onChangeCombination diff --git a/addons/website_sale_stock/static/src/js/website_sale.js b/addons/website_sale_stock/static/src/js/website_sale.js index 7a85f4bd4b3fa..d1b27e3051704 100644 --- a/addons/website_sale_stock/static/src/js/website_sale.js +++ b/addons/website_sale_stock/static/src/js/website_sale.js @@ -1,7 +1,7 @@ -/** @odoo-module alias=website_sale_stock.website_sale**/ +/** @odoo-module **/ -import { WebsiteSale } from 'website_sale.website_sale'; -import { is_email } from 'web.utils'; +import { WebsiteSale } from '@website_sale/js/website_sale'; +import { is_email } from '@web/legacy/js/core/utils'; WebsiteSale.include({ events: Object.assign({}, WebsiteSale.prototype.events, { diff --git a/addons/website_sale_stock_wishlist/static/src/js/variant.js b/addons/website_sale_stock_wishlist/static/src/js/variant.js index 95b0c28720e74..2c4385c14c155 100644 --- a/addons/website_sale_stock_wishlist/static/src/js/variant.js +++ b/addons/website_sale_stock_wishlist/static/src/js/variant.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import VariantMixin from "website_sale_stock.VariantMixin"; -import "website_sale.website_sale"; -import { qweb as QWeb } from "web.core"; +import VariantMixin from "@website_sale_stock/js/variant_mixin"; +import "@website_sale/js/website_sale"; +import { qweb as QWeb } from "@web/legacy/js/services/core"; const oldChangeCombinationStock = VariantMixin._onChangeCombinationStock; /** diff --git a/addons/website_sale_stock_wishlist/static/src/js/website_sale.js b/addons/website_sale_stock_wishlist/static/src/js/website_sale.js index 92ea427f02392..0e355359e6b2a 100644 --- a/addons/website_sale_stock_wishlist/static/src/js/website_sale.js +++ b/addons/website_sale_stock_wishlist/static/src/js/website_sale.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import WebsiteSale from 'website_sale_stock.website_sale'; +import WebsiteSale from '@website_sale_stock/js/website_sale'; WebsiteSale.include({ diff --git a/addons/website_sale_stock_wishlist/static/src/js/wishlist.js b/addons/website_sale_stock_wishlist/static/src/js/wishlist.js index 67c713659e140..ec00d5e027bb7 100644 --- a/addons/website_sale_stock_wishlist/static/src/js/wishlist.js +++ b/addons/website_sale_stock_wishlist/static/src/js/wishlist.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import publicWidget from 'web.public.widget'; -import 'website_sale_wishlist.wishlist'; +import publicWidget from '@web/legacy/js/public/public_widget'; +import '@website_sale_wishlist/js/website_sale_wishlist'; publicWidget.registry.ProductWishlist.include({ diff --git a/addons/website_sale_wishlist/static/src/js/website_sale.js b/addons/website_sale_wishlist/static/src/js/website_sale.js index f62b0f04405b6..ad685ea99d733 100644 --- a/addons/website_sale_wishlist/static/src/js/website_sale.js +++ b/addons/website_sale_wishlist/static/src/js/website_sale.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import { WebsiteSale } from 'website_sale.website_sale'; +import { WebsiteSale } from '@website_sale/js/website_sale'; WebsiteSale.include({ /** diff --git a/addons/website_sale_wishlist/static/src/js/website_sale_wishlist.js b/addons/website_sale_wishlist/static/src/js/website_sale_wishlist.js index 892e53a8548de..57ae4a808c694 100644 --- a/addons/website_sale_wishlist/static/src/js/website_sale_wishlist.js +++ b/addons/website_sale_wishlist/static/src/js/website_sale_wishlist.js @@ -1,8 +1,8 @@ -/** @odoo-module alias=website_sale_wishlist.wishlist **/ +/** @odoo-module **/ -import publicWidget from "web.public.widget"; -import wSaleUtils from "website_sale.utils"; -import VariantMixin from "website_sale.SaleVariantMixin"; +import publicWidget from "@web/legacy/js/public/public_widget"; +import wSaleUtils from "@website_sale/js/website_sale_utils"; +import VariantMixin from "@website_sale/js/sale_variant_mixin"; // VariantMixin events are overridden on purpose here // to avoid registering them more than once since they are already registered diff --git a/addons/website_sale_wishlist/static/tests/tours/website_sale_wishlist.js b/addons/website_sale_wishlist/static/tests/tours/website_sale_wishlist.js index fc45f69444cf6..fa8d52583be82 100644 --- a/addons/website_sale_wishlist/static/tests/tours/website_sale_wishlist.js +++ b/addons/website_sale_wishlist/static/tests/tours/website_sale_wishlist.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import rpc from "web.rpc"; +import rpc from "@web/legacy/js/core/rpc"; import { registry } from "@web/core/registry"; registry.category("web_tour.tours").add('shop_wishlist', { diff --git a/addons/website_sale_wishlist/static/tests/tours/website_sale_wishlist_admin.js b/addons/website_sale_wishlist/static/tests/tours/website_sale_wishlist_admin.js index cc4bbd686f25e..8c2eb524acf01 100644 --- a/addons/website_sale_wishlist/static/tests/tours/website_sale_wishlist_admin.js +++ b/addons/website_sale_wishlist/static/tests/tours/website_sale_wishlist_admin.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from "website.tour_utils"; +import wTourUtils from "@website/js/tours/tour_utils"; wTourUtils.registerWebsitePreviewTour('shop_wishlist_admin', { url: '/shop?search=Rock', diff --git a/addons/website_slides/static/src/js/components/editor.js b/addons/website_slides/static/src/js/components/editor.js index 3846e0d22b690..29611eff21ff3 100644 --- a/addons/website_slides/static/src/js/components/editor.js +++ b/addons/website_slides/static/src/js/components/editor.js @@ -2,7 +2,7 @@ import { WebsiteEditorComponent } from '@website/components/editor/editor'; import { WebsiteTranslator } from '@website/components/translator/translator'; -import { patch } from 'web.utils'; +import { patch } from '@web/legacy/js/core/utils'; patch(WebsiteEditorComponent.prototype, 'website_slides_editor', { /** diff --git a/addons/website_slides/static/src/js/portal_chatter.js b/addons/website_slides/static/src/js/portal_chatter.js index cc6e1b08aeb78..bd6f7cac8a02a 100644 --- a/addons/website_slides/static/src/js/portal_chatter.js +++ b/addons/website_slides/static/src/js/portal_chatter.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import { _t } from 'web.core'; -import { PortalChatter } from 'portal.chatter'; +import { _t } from "@web/legacy/js/services/core"; +import PortalChatter from '@portal/js/portal_chatter'; import { sprintf } from '@web/core/utils/strings'; /** diff --git a/addons/website_slides/static/src/js/slides.js b/addons/website_slides/static/src/js/slides.js index f2a605dae334f..1a959b2a6e2b1 100644 --- a/addons/website_slides/static/src/js/slides.js +++ b/addons/website_slides/static/src/js/slides.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import publicWidget from 'web.public.widget'; -import time from 'web.time'; +import publicWidget from '@web/legacy/js/public/public_widget'; +import time from '@web/legacy/js/core/time'; const { DateTime } = luxon; publicWidget.registry.websiteSlides = publicWidget.Widget.extend({ diff --git a/addons/website_slides/static/src/js/slides_category_add.js b/addons/website_slides/static/src/js/slides_category_add.js index fc95478402f38..1ea7856902308 100644 --- a/addons/website_slides/static/src/js/slides_category_add.js +++ b/addons/website_slides/static/src/js/slides_category_add.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import publicWidget from 'web.public.widget'; -import Dialog from 'web.Dialog'; -import { _t } from 'web.core'; +import publicWidget from '@web/legacy/js/public/public_widget'; +import Dialog from '@web/legacy/js/core/dialog'; +import { _t } from "@web/legacy/js/services/core"; var CategoryAddDialog = Dialog.extend({ template: 'slides.category.add', diff --git a/addons/website_slides/static/src/js/slides_category_delete.js b/addons/website_slides/static/src/js/slides_category_delete.js index ce5fb0456af19..ce741e859861b 100644 --- a/addons/website_slides/static/src/js/slides_category_delete.js +++ b/addons/website_slides/static/src/js/slides_category_delete.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import publicWidget from 'web.public.widget'; -import Dialog from 'web.Dialog'; -import { _t } from 'web.core'; +import publicWidget from '@web/legacy/js/public/public_widget'; +import Dialog from '@web/legacy/js/core/dialog'; +import { _t } from "@web/legacy/js/services/core"; const categoryDeleteDialog = Dialog.extend({ template: 'slides.category.delete', diff --git a/addons/website_slides/static/src/js/slides_course_enroll_email.js b/addons/website_slides/static/src/js/slides_course_enroll_email.js index 38ca66b6af01e..76745cf326b1f 100644 --- a/addons/website_slides/static/src/js/slides_course_enroll_email.js +++ b/addons/website_slides/static/src/js/slides_course_enroll_email.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import { _t } from 'web.core'; -import Dialog from 'web.Dialog'; -import publicWidget from 'web.public.widget'; +import { _t } from "@web/legacy/js/services/core"; +import Dialog from '@web/legacy/js/core/dialog'; +import publicWidget from '@web/legacy/js/public/public_widget'; var SlideEnrollDialog = Dialog.extend({ template: 'slide.course.join.request', @@ -42,7 +42,7 @@ var SlideEnrollDialog = Dialog.extend({ self.close(); }); } - + }); publicWidget.registry.websiteSlidesEnroll = publicWidget.Widget.extend({ @@ -54,18 +54,18 @@ publicWidget.registry.websiteSlidesEnroll = publicWidget.Widget.extend({ //-------------------------------------------------------------------------- // Private //-------------------------------------------------------------------------- - + _openDialog: function (channelId) { new SlideEnrollDialog(this, { channelId: channelId, $element: this.$el.closest('.alert') }).open(); }, - + //-------------------------------------------------------------------------- // Handlers //-------------------------------------------------------------------------- - + _onSendRequestClick: function (ev) { ev.preventDefault(); this._openDialog($(ev.currentTarget).data('channelId')); diff --git a/addons/website_slides/static/src/js/slides_course_fullscreen_player.js b/addons/website_slides/static/src/js/slides_course_fullscreen_player.js index 74b9a83bb3dac..b44a8f48aceda 100644 --- a/addons/website_slides/static/src/js/slides_course_fullscreen_player.js +++ b/addons/website_slides/static/src/js/slides_course_fullscreen_player.js @@ -2,15 +2,15 @@ /* global YT, Vimeo */ - import publicWidget from 'web.public.widget'; - import { qweb as QWeb, _t } from 'web.core'; - import { Markup } from 'web.utils'; - import config from 'web.config'; + import publicWidget from '@web/legacy/js/public/public_widget'; + import { qweb as QWeb, _t } from "@web/legacy/js/services/core"; + import { Markup } from "@web/legacy/js/core/utils"; + import config from '@web/legacy/js/services/config'; import session from 'web.session'; import { Quiz } from '@website_slides/js/slides_course_quiz'; import { SlideCoursePage } from '@website_slides/js/slides_course_page'; - import Dialog from 'web.Dialog'; + import Dialog from '@web/legacy/js/core/dialog'; import '@website_slides/js/slides_course_join'; /** @@ -696,7 +696,7 @@ * When the current slide is changed, widget will be automatically updated * and allowed to: fetch the content if needed, render it, update the url, * and set slide as "completed" according to its category requirements. In - * mobile case (i.e. limited screensize), sidebar will be toggled since + * mobile case (i.e. limited screensize), sidebar will be toggled since * sidebar will block most or all of new slide visibility. * * @private diff --git a/addons/website_slides/static/src/js/slides_course_join.js b/addons/website_slides/static/src/js/slides_course_join.js index fdf5fab4653a6..de474bfd01be4 100644 --- a/addons/website_slides/static/src/js/slides_course_join.js +++ b/addons/website_slides/static/src/js/slides_course_join.js @@ -1,8 +1,8 @@ /** @odoo-module **/ import { sprintf } from '@web/core/utils/strings'; -import { _t, qweb } from 'web.core'; -import publicWidget from 'web.public.widget'; +import { _t, qweb } from "@web/legacy/js/services/core"; +import publicWidget from '@web/legacy/js/public/public_widget'; var CourseJoinWidget = publicWidget.Widget.extend({ template: 'slide.course.join', diff --git a/addons/website_slides/static/src/js/slides_course_page.js b/addons/website_slides/static/src/js/slides_course_page.js index f6cfa7f173b6b..7419d987c2821 100644 --- a/addons/website_slides/static/src/js/slides_course_page.js +++ b/addons/website_slides/static/src/js/slides_course_page.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import publicWidget from 'web.public.widget'; +import publicWidget from '@web/legacy/js/public/public_widget'; import session from 'web.session'; -import { qweb as QWeb } from 'web.core'; +import { qweb as QWeb } from "@web/legacy/js/services/core"; /** diff --git a/addons/website_slides/static/src/js/slides_course_prerequisite.js b/addons/website_slides/static/src/js/slides_course_prerequisite.js index 85b8d8fecf9d0..471ecd0ba748b 100644 --- a/addons/website_slides/static/src/js/slides_course_prerequisite.js +++ b/addons/website_slides/static/src/js/slides_course_prerequisite.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import { qweb } from 'web.core'; -import publicWidget from 'web.public.widget'; +import { qweb } from "@web/legacy/js/services/core"; +import publicWidget from '@web/legacy/js/public/public_widget'; publicWidget.registry.websiteSlidesCoursePrerequisite = publicWidget.Widget.extend({ selector: '.o_wslides_js_prerequisite_course', diff --git a/addons/website_slides/static/src/js/slides_course_quiz.js b/addons/website_slides/static/src/js/slides_course_quiz.js index 2ba28402e582c..1bba40197795c 100644 --- a/addons/website_slides/static/src/js/slides_course_quiz.js +++ b/addons/website_slides/static/src/js/slides_course_quiz.js @@ -1,10 +1,10 @@ /** @odoo-module **/ - import publicWidget from 'web.public.widget'; - import Dialog from 'web.Dialog'; - import { qweb as QWeb, _t } from 'web.core'; + import publicWidget from '@web/legacy/js/public/public_widget'; + import Dialog from '@web/legacy/js/core/dialog'; + import { qweb as QWeb, _t } from "@web/legacy/js/services/core"; import session from 'web.session'; - import { Markup } from 'web.utils'; + import { Markup } from "@web/legacy/js/core/utils"; import CourseJoin from '@website_slides/js/slides_course_join'; import QuestionFormWidget from '@website_slides/js/slides_course_quiz_question_form'; import SlideQuizFinishModal from '@website_slides/js/slides_course_quiz_finish'; @@ -304,7 +304,7 @@ }, /* * Toggle additional resource info box - * + * * @private * @param {Boolean} show - Whether show or hide the information */ diff --git a/addons/website_slides/static/src/js/slides_course_quiz_finish.js b/addons/website_slides/static/src/js/slides_course_quiz_finish.js index b96f8b3fff7cd..df71d173a4e70 100644 --- a/addons/website_slides/static/src/js/slides_course_quiz_finish.js +++ b/addons/website_slides/static/src/js/slides_course_quiz_finish.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import Dialog from 'web.Dialog'; -import { _t } from 'web.core'; +import Dialog from '@web/legacy/js/core/dialog'; +import { _t } from "@web/legacy/js/services/core"; /** * This modal is used when the user finishes the quiz. diff --git a/addons/website_slides/static/src/js/slides_course_quiz_question_form.js b/addons/website_slides/static/src/js/slides_course_quiz_question_form.js index 8f9e53803ea10..fc4048573cba2 100644 --- a/addons/website_slides/static/src/js/slides_course_quiz_question_form.js +++ b/addons/website_slides/static/src/js/slides_course_quiz_question_form.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import publicWidget from 'web.public.widget'; -import core from 'web.core'; +import publicWidget from '@web/legacy/js/public/public_widget'; +import core from "@web/legacy/js/services/core"; var QWeb = core.qweb; var _t = core._t; diff --git a/addons/website_slides/static/src/js/slides_course_slides_list.js b/addons/website_slides/static/src/js/slides_course_slides_list.js index c2d0a5754c7ac..e72ead0c0a1c0 100644 --- a/addons/website_slides/static/src/js/slides_course_slides_list.js +++ b/addons/website_slides/static/src/js/slides_course_slides_list.js @@ -1,7 +1,7 @@ /** @odoo-module **/ -import publicWidget from 'web.public.widget'; -import { _t } from 'web.core'; +import publicWidget from '@web/legacy/js/public/public_widget'; +import { _t } from "@web/legacy/js/services/core"; import { SlideCoursePage } from '@website_slides/js/slides_course_page'; publicWidget.registry.websiteSlidesCourseSlidesList = SlideCoursePage.extend({ diff --git a/addons/website_slides/static/src/js/slides_course_tag_add.js b/addons/website_slides/static/src/js/slides_course_tag_add.js index 708933303de24..97d4669b6c69d 100644 --- a/addons/website_slides/static/src/js/slides_course_tag_add.js +++ b/addons/website_slides/static/src/js/slides_course_tag_add.js @@ -2,9 +2,9 @@ import { uniqueId } from '@web/core/utils/functions'; import { sprintf } from '@web/core/utils/strings'; -import { _t } from 'web.core'; -import Dialog from 'web.Dialog'; -import publicWidget from 'web.public.widget'; +import { _t } from "@web/legacy/js/services/core"; +import Dialog from '@web/legacy/js/core/dialog'; +import publicWidget from '@web/legacy/js/public/public_widget'; var TagCourseDialog = Dialog.extend({ template: 'website.slides.tag.add', @@ -16,7 +16,7 @@ var TagCourseDialog = Dialog.extend({ * @override * @param {Object} parent * @param {Object} options holding channelId - * + * */ init: function (parent, options) { options = Object.assign({ @@ -203,7 +203,7 @@ var TagCourseDialog = Dialog.extend({ _formValidate: function ($form) { $form.addClass('was-validated'); var result = $form[0].checkValidity(); - + var $tagInput = this.$('#tag_id'); if ($tagInput.length !== 0){ var $tagSelect2Container = $tagInput @@ -240,7 +240,7 @@ var TagCourseDialog = Dialog.extend({ _alertRemove: function () { this.$('.alert-warning').remove(); }, - + /** * When the user IS NOT creating a new tag, this function hides the group tag field * and makes it not required. Since the select2 field makes an extra container, this diff --git a/addons/website_slides/static/src/js/slides_course_unsubscribe.js b/addons/website_slides/static/src/js/slides_course_unsubscribe.js index 84306be9f76e6..4134df2a0e5dc 100644 --- a/addons/website_slides/static/src/js/slides_course_unsubscribe.js +++ b/addons/website_slides/static/src/js/slides_course_unsubscribe.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import core from 'web.core'; -import Dialog from 'web.Dialog'; -import publicWidget from 'web.public.widget'; +import core from "@web/legacy/js/services/core"; +import Dialog from '@web/legacy/js/core/dialog'; +import publicWidget from '@web/legacy/js/public/public_widget'; var QWeb = core.qweb; var _t = core._t; diff --git a/addons/website_slides/static/src/js/slides_share.js b/addons/website_slides/static/src/js/slides_share.js index cdb64ba6ca6ad..28d0f86036368 100644 --- a/addons/website_slides/static/src/js/slides_share.js +++ b/addons/website_slides/static/src/js/slides_share.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import publicWidget from 'web.public.widget'; +import publicWidget from '@web/legacy/js/public/public_widget'; import '@website_slides/js/slides'; -import { _t } from 'web.core'; +import { _t } from "@web/legacy/js/services/core"; var ShareMail = publicWidget.Widget.extend({ events: { diff --git a/addons/website_slides/static/src/js/slides_slide_archive.js b/addons/website_slides/static/src/js/slides_slide_archive.js index 70b5a37dd2ffd..3c6845665d024 100644 --- a/addons/website_slides/static/src/js/slides_slide_archive.js +++ b/addons/website_slides/static/src/js/slides_slide_archive.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import publicWidget from 'web.public.widget'; -import Dialog from 'web.Dialog'; -import { _t } from 'web.core'; +import publicWidget from '@web/legacy/js/public/public_widget'; +import Dialog from '@web/legacy/js/core/dialog'; +import { _t } from "@web/legacy/js/services/core"; var SlideArchiveDialog = Dialog.extend({ template: 'slides.slide.archive', diff --git a/addons/website_slides/static/src/js/slides_slide_like.js b/addons/website_slides/static/src/js/slides_slide_like.js index a6d64cd26ab6e..c515b313158a0 100644 --- a/addons/website_slides/static/src/js/slides_slide_like.js +++ b/addons/website_slides/static/src/js/slides_slide_like.js @@ -1,8 +1,8 @@ /** @odoo-module **/ import { sprintf } from '@web/core/utils/strings'; -import { _t } from 'web.core'; -import publicWidget from 'web.public.widget'; +import { _t } from "@web/legacy/js/services/core"; +import publicWidget from '@web/legacy/js/public/public_widget'; import '@website_slides/js/slides'; var SlideLikeWidget = publicWidget.Widget.extend({ diff --git a/addons/website_slides/static/src/js/slides_slide_toggle_is_preview.js b/addons/website_slides/static/src/js/slides_slide_toggle_is_preview.js index 3d775d66a4614..b51d2746ef9f4 100644 --- a/addons/website_slides/static/src/js/slides_slide_toggle_is_preview.js +++ b/addons/website_slides/static/src/js/slides_slide_toggle_is_preview.js @@ -1,6 +1,6 @@ /** @odoo-module **/ - import publicWidget from 'web.public.widget'; + import publicWidget from '@web/legacy/js/public/public_widget'; publicWidget.registry.websiteSlidesSlideToggleIsPreview = publicWidget.Widget.extend({ selector: '.o_wslides_js_slide_toggle_is_preview', diff --git a/addons/website_slides/static/src/js/slides_upload.js b/addons/website_slides/static/src/js/slides_upload.js index 24b981cbf520d..93f421110ef0b 100644 --- a/addons/website_slides/static/src/js/slides_upload.js +++ b/addons/website_slides/static/src/js/slides_upload.js @@ -2,11 +2,11 @@ import { uniqueId } from '@web/core/utils/functions'; import { sprintf } from '@web/core/utils/strings'; -import {_t, qweb as QWeb} from 'web.core'; -import Dialog from 'web.Dialog'; -import publicWidget from 'web.public.widget'; -import utils from 'web.utils'; -import wUtils from 'website.utils'; +import {_t, qweb as QWeb} from "@web/legacy/js/services/core"; +import Dialog from '@web/legacy/js/core/dialog'; +import publicWidget from '@web/legacy/js/public/public_widget'; +import utils from '@web/legacy/js/core/utils'; +import wUtils from '@website/js/utils'; var SlideUploadDialog = Dialog.extend({ template: 'website.slide.upload.modal', diff --git a/addons/website_slides/static/src/js/systray_items/new_content.js b/addons/website_slides/static/src/js/systray_items/new_content.js index 61992600342ac..03ef9d60b2ccd 100644 --- a/addons/website_slides/static/src/js/systray_items/new_content.js +++ b/addons/website_slides/static/src/js/systray_items/new_content.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { NewContentModal, MODULE_STATUS } from '@website/systray_items/new_content'; -import { patch } from 'web.utils'; +import { patch } from '@web/legacy/js/core/utils'; patch(NewContentModal.prototype, 'website_slides_new_content', { setup() { diff --git a/addons/website_slides/static/src/js/tours/slides_tour.js b/addons/website_slides/static/src/js/tours/slides_tour.js index 14d0e36713274..8434caeb37c78 100644 --- a/addons/website_slides/static/src/js/tours/slides_tour.js +++ b/addons/website_slides/static/src/js/tours/slides_tour.js @@ -1,9 +1,9 @@ /** @odoo-module **/ -import {_t} from "web.core"; -import {Markup} from "web.utils"; -import wTourUtils from "website.tour_utils"; -import "web.legacy_tranlations_loaded"; +import {_t} from "@web/legacy/js/services/core"; +import { Markup } from "@web/legacy/js/core/utils"; +import wTourUtils from "@website/js/tours/tour_utils"; +import "@web/legacy/translations_loaded"; wTourUtils.registerWebsitePreviewTour('slides_tour', { url: '/slides', diff --git a/addons/website_slides/static/tests/tours/slide_course_publisher_standard.js b/addons/website_slides/static/tests/tours/slide_course_publisher_standard.js index 86e50e5f2d6c6..52df94bc9b8a2 100644 --- a/addons/website_slides/static/tests/tours/slide_course_publisher_standard.js +++ b/addons/website_slides/static/tests/tours/slide_course_publisher_standard.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import slidesTourTools from '@website_slides/../tests/tours/slides_tour_tools'; -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; /** * Global use case: diff --git a/addons/website_slides/static/tests/tours/slides_course_publisher.js b/addons/website_slides/static/tests/tours/slides_course_publisher.js index a625d76d991b5..1b82a1cba1f1f 100644 --- a/addons/website_slides/static/tests/tours/slides_course_publisher.js +++ b/addons/website_slides/static/tests/tours/slides_course_publisher.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; import slidesTourTools from '@website_slides/../tests/tours/slides_tour_tools'; /** diff --git a/addons/website_slides/static/tests/tours/slides_full_screen_web_editor.js b/addons/website_slides/static/tests/tours/slides_full_screen_web_editor.js index b3c9a8c615a16..ac15ac5ddb059 100644 --- a/addons/website_slides/static/tests/tours/slides_full_screen_web_editor.js +++ b/addons/website_slides/static/tests/tours/slides_full_screen_web_editor.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import wTourUtils from 'website.tour_utils'; +import wTourUtils from '@website/js/tours/tour_utils'; /** * Global use case: diff --git a/addons/website_slides/static/tests/tours/slides_tour_tools.js b/addons/website_slides/static/tests/tours/slides_tour_tools.js index d602a9d9c6d8a..e0240c0cbc95b 100644 --- a/addons/website_slides/static/tests/tours/slides_tour_tools.js +++ b/addons/website_slides/static/tests/tours/slides_tour_tools.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import utils from 'web.utils'; +import utils from '@web/legacy/js/core/utils'; /* * Constant diff --git a/addons/website_slides_survey/static/src/js/slides_course_fullscreen_player.js b/addons/website_slides_survey/static/src/js/slides_course_fullscreen_player.js index 86882f897ac4a..e43c1381d4ca1 100644 --- a/addons/website_slides_survey/static/src/js/slides_course_fullscreen_player.js +++ b/addons/website_slides_survey/static/src/js/slides_course_fullscreen_player.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import core from "web.core"; +import core from "@web/legacy/js/services/core"; var QWeb = core.qweb; import Fullscreen from "@website_slides/js/slides_course_fullscreen_player"; diff --git a/addons/website_slides_survey/static/src/js/slides_upload.js b/addons/website_slides_survey/static/src/js/slides_upload.js index 5afc336328851..173f4aaf81c09 100644 --- a/addons/website_slides_survey/static/src/js/slides_upload.js +++ b/addons/website_slides_survey/static/src/js/slides_upload.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import core from "web.core"; +import core from "@web/legacy/js/services/core"; var _t = core._t; import SlidesUpload from "@website_slides/js/slides_upload"; diff --git a/addons/website_twitter/static/src/js/website.twitter.animation.js b/addons/website_twitter/static/src/js/website.twitter.animation.js index c0d99e3a8e130..8c9a91b46b4ec 100644 --- a/addons/website_twitter/static/src/js/website.twitter.animation.js +++ b/addons/website_twitter/static/src/js/website.twitter.animation.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import core from "web.core"; -import {Markup} from "web.utils"; -import publicWidget from "web.public.widget"; +import core from "@web/legacy/js/services/core"; +import { Markup } from "@web/legacy/js/core/utils"; +import publicWidget from "@web/legacy/js/public/public_widget"; import { escape } from "@web/core/utils/strings"; var qweb = core.qweb; diff --git a/addons/website_twitter/static/src/js/website.twitter.editor.js b/addons/website_twitter/static/src/js/website.twitter.editor.js index 8e54431ae2c9c..c2901ba8a0a6b 100644 --- a/addons/website_twitter/static/src/js/website.twitter.editor.js +++ b/addons/website_twitter/static/src/js/website.twitter.editor.js @@ -1,8 +1,8 @@ /** @odoo-module **/ -import core from "web.core"; -import dom from "web.dom"; -import sOptions from "web_editor.snippets.options"; +import core from "@web/legacy/js/services/core"; +import dom from "@web/legacy/js/core/dom"; +import sOptions from "@web_editor/js/editor/snippets.options"; var _t = core._t; diff --git a/odoo/addons/test_apikeys/static/tests/apikey_flow.js b/odoo/addons/test_apikeys/static/tests/apikey_flow.js index 6280aca4b7f19..48842227c2ff6 100644 --- a/odoo/addons/test_apikeys/static/tests/apikey_flow.js +++ b/odoo/addons/test_apikeys/static/tests/apikey_flow.js @@ -1,7 +1,7 @@ /** @odoo-module **/ import { registry } from "@web/core/registry"; -import ajax from "web.ajax"; +import ajax from "@web/legacy/js/core/ajax"; registry.category("web_tour.tours").add('apikeys_tour_setup', { test: true, diff --git a/odoo/addons/test_main_flows/static/tests/tours/main_flow.js b/odoo/addons/test_main_flows/static/tests/tours/main_flow.js index ecd5cfec880d7..c471fc86be9dc 100644 --- a/odoo/addons/test_main_flows/static/tests/tours/main_flow.js +++ b/odoo/addons/test_main_flows/static/tests/tours/main_flow.js @@ -1,10 +1,10 @@ /** @odoo-module **/ -import {_t} from "web.core"; -import {Markup} from "web.utils"; +import {_t} from "@web/legacy/js/services/core"; +import { Markup } from "@web/legacy/js/core/utils"; import { registry } from "@web/core/registry"; import { stepUtils } from "@web_tour/tour_service/tour_utils"; -import "web.legacy_tranlations_loaded"; +import "@web/legacy/translations_loaded"; registry.category("web_tour.tours").add('main_flow_tour', { test: true,