Skip to content

Commit

Permalink
[IMP] *: Remove alias in JS files
Browse files Browse the repository at this point in the history
Rename all imports with alias old system to the new js module system
Task ID: 3266759

closes odoo#127414

Related: odoo/design-themes#671
Related: odoo/enterprise#43716
Signed-off-by: Bastien Pierre (ipb) <[email protected]>
  • Loading branch information
bastien-ipb committed Jul 27, 2023
1 parent 714e254 commit 65242e3
Show file tree
Hide file tree
Showing 606 changed files with 1,826 additions and 1,792 deletions.
5 changes: 2 additions & 3 deletions addons/account/static/src/js/account_portal.js
Original file line number Diff line number Diff line change
@@ -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
*/
Expand Down
8 changes: 4 additions & 4 deletions addons/account/static/src/js/account_portal_sidebar.js
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
8 changes: 4 additions & 4 deletions addons/account/static/src/js/tours/account.js
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
2 changes: 1 addition & 1 deletion addons/account/static/tests/tours/tax_group_tests.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @odoo-module alias=account.tax.group.tour.tests */
/** @odoo-module */
"use strict";

import { registry } from "@web/core/registry";
Expand Down
8 changes: 4 additions & 4 deletions addons/account_payment/static/src/js/payment_form.js
Original file line number Diff line number Diff line change
@@ -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 = {

Expand All @@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion addons/auth_signup/static/src/js/signup.js
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
2 changes: 1 addition & 1 deletion addons/auth_totp/static/tests/totp_flow.js
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
8 changes: 4 additions & 4 deletions addons/auth_totp_portal/static/src/js/totp_frontend.js
Original file line number Diff line number Diff line change
@@ -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 <field> elements by normal HTML, strip out the rest entirely
Expand Down
2 changes: 1 addition & 1 deletion addons/auth_totp_portal/static/tests/totp_portal.js
Original file line number Diff line number Diff line change
@@ -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', {
Expand Down
6 changes: 3 additions & 3 deletions addons/barcodes/static/src/js/barcode_events.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
8 changes: 4 additions & 4 deletions addons/barcodes/static/tests/mobile/barcode_mobile_tests.js
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -24,7 +24,7 @@
keyCode: keycode,
});
}

QUnit.module('Barcodes', {
before() {
barcodeService.maxTimeBetweenKeysInMs = 0;
Expand Down Expand Up @@ -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");
}
Expand Down
2 changes: 1 addition & 1 deletion addons/board/static/tests/add_to_dashboard_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion addons/bus/static/src/services/presence_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion addons/bus/static/tests/helpers/mock_python_environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down
6 changes: 3 additions & 3 deletions addons/calendar/static/src/activity/activity_menu_patch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -16,7 +16,7 @@ patch(ActivityMenu.prototype, "calendar", {
fieldUtils.parse.datetime(meeting.start, false, { isUTC: true })
)
.local()
.format(getLangTimeFormat());
.format(time.getLangTimeFormat());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
/**
Expand Down
6 changes: 3 additions & 3 deletions addons/crm/static/src/js/tours/crm.js
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
4 changes: 2 additions & 2 deletions addons/crm/static/tests/forecast_kanban_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
*/
Expand Down Expand Up @@ -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)
*/
Expand Down
2 changes: 1 addition & 1 deletion addons/crm/static/tests/forecast_view_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
6 changes: 3 additions & 3 deletions addons/crm_iap_mine/static/src/js/tours/crm_iap_lead.js
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
4 changes: 2 additions & 2 deletions addons/event/static/src/js/tours/event_steps.js
Original file line number Diff line number Diff line change
@@ -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({

Expand Down
8 changes: 4 additions & 4 deletions addons/event/static/src/js/tours/event_tour.js
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
8 changes: 4 additions & 4 deletions addons/google_recaptcha/static/src/js/recaptcha.js
Original file line number Diff line number Diff line change
@@ -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
*/
Expand Down
4 changes: 2 additions & 2 deletions addons/hr/static/src/js/m2x_avatar_employee.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion addons/hr/static/src/messaging_service_patch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion addons/hr/static/src/thread_service_patch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion addons/hr/static/tests/m2x_avatar_employee_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
6 changes: 3 additions & 3 deletions addons/hr_expense/static/src/js/tours/hr_expense.js
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion addons/hr_holidays/static/src/dashboard/time_off_card.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @odoo-module */

import Popover from "web.Popover";
import Popover from "@web/legacy/js/core/popover";

const { Component } = owl;

Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
Loading

0 comments on commit 65242e3

Please sign in to comment.