[REF] point_of_sale, pos*: adapt import to moved files

pos*: l10n_co_pos, l10n_fr_pos_cert, l10n_gcc_pos, l10n_in_pos,
l10n_sa_pos, pos_adyen, pos_discount, pos_epson_printer, pos_hr,
pos_hr_restaurant, pos_loyalty, pos_mercury, pos_restaurant, pos_sale,
pos_sale_loyalty, pos_sale_product_configurator, pos_six, pos_stripe

The previous commit reorganizes the files in the pos, this commit
renames all of the imports of those files to match their new location.
This is done in a separate commit to allow git to better keep track of
the changes and apply forward-ports more seamlessly.

Part-of: odoo/odoo#123498
This commit is contained in:
Samuel Degueldre
2023-06-05 17:51:06 +02:00
parent 97bfa68dfb
commit cb2a53d573
155 changed files with 419 additions and 396 deletions
@@ -1,6 +1,6 @@
/** @odoo-module */
import { PaymentScreen } from "@point_of_sale/js/Screens/PaymentScreen/PaymentScreen";
import { PaymentScreen } from "@point_of_sale/app/screens/payment_screen/payment_screen";
import { patch } from "@web/core/utils/patch";
patch(PaymentScreen.prototype, "l10n_co_pos.PaymentScreen", {
+1 -1
View File
@@ -1,6 +1,6 @@
/** @odoo-module */
import { PosGlobalState, Order } from "@point_of_sale/js/models";
import { PosGlobalState, Order } from "@point_of_sale/app/store/models";
import { patch } from "@web/core/utils/patch";
patch(PosGlobalState.prototype, "l10n_co_pos.PosGlobalState", {
@@ -1,8 +1,8 @@
/** @odoo-module */
import { Chrome } from "@point_of_sale/js/Chrome";
import { Chrome } from "@point_of_sale/app/pos_app";
import { patch } from "@web/core/utils/patch";
import { ClosePosPopup } from "@point_of_sale/js/Popups/ClosePosPopup";
import { ClosePosPopup } from "@point_of_sale/app/navbar/closing_popup/closing_popup";
import { onMounted } from "@odoo/owl";
patch(Chrome.prototype, "l10n_fr_pos_cert.Chrome", {
@@ -1,6 +1,6 @@
/** @odoo-module */
import { PaymentScreen } from "@point_of_sale/js/Screens/PaymentScreen/PaymentScreen";
import { PaymentScreen } from "@point_of_sale/app/screens/payment_screen/payment_screen";
import { patch } from "@web/core/utils/patch";
patch(PaymentScreen.prototype, "l10n_fr_pos_cert.PaymentScreen", {
@@ -1,6 +1,6 @@
/** @odoo-module */
import { ClosePosPopup } from "@point_of_sale/js/Popups/ClosePosPopup";
import { ClosePosPopup } from "@point_of_sale/app/navbar/closing_popup/closing_popup";
import { patch } from "@web/core/utils/patch";
patch(ClosePosPopup.prototype, "l10n_fr_pos_cert.ClosePosPopup", {
+2 -2
View File
@@ -1,10 +1,10 @@
/** @odoo-module */
import { PosGlobalState, Order, Orderline } from "@point_of_sale/js/models";
import { PosGlobalState, Order, Orderline } from "@point_of_sale/app/store/models";
import { _t } from "@web/core/l10n/translation";
import { patch } from "@web/core/utils/patch";
import { sprintf } from "@web/core/utils/strings";
import { ErrorPopup } from "@point_of_sale/js/Popups/ErrorPopup";
import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup";
patch(PosGlobalState.prototype, "l10n_fr_pos_cert.PosGlobalState", {
is_french_country() {
@@ -1,6 +1,6 @@
/** @odoo-module */
import { OrderReceipt } from "@point_of_sale/js/Screens/ReceiptScreen/OrderReceipt";
import { OrderReceipt } from "@point_of_sale/app/screens/receipt_screen/receipt/receipt";
import { patch } from "@web/core/utils/patch";
patch(OrderReceipt.prototype, "l10n_gcc_pos.OrderReceipt", {
@@ -8,7 +8,9 @@ patch(OrderReceipt.prototype, "l10n_gcc_pos.OrderReceipt", {
const receipt_render_env = this._super(...arguments);
const receipt = receipt_render_env.receipt;
const country = receipt_render_env.order.pos.company.country;
receipt.is_gcc_country = country ? ["SA", "AE", "BH", "OM", "QA", "KW"].includes(country && country.code) : false;
receipt.is_gcc_country = country
? ["SA", "AE", "BH", "OM", "QA", "KW"].includes(country && country.code)
: false;
return receipt_render_env;
},
});
+1 -1
View File
@@ -1,6 +1,6 @@
/** @odoo-module */
import { Orderline } from "@point_of_sale/js/models";
import { Orderline } from "@point_of_sale/app/store/models";
import { patch } from "@web/core/utils/patch";
patch(Orderline.prototype, "l10n_in_pos.Orderline", {
+1 -1
View File
@@ -1,6 +1,6 @@
/** @odoo-module */
import { Order } from "@point_of_sale/js/models";
import { Order } from "@point_of_sale/app/store/models";
import { patch } from "@web/core/utils/patch";
patch(Order.prototype, "l10n_sa_pos.Order", {
+25
View File
@@ -0,0 +1,25 @@
declare module "services" {
import { barcodeReaderService } from "@point_of_sale/app/barcode/barcode_reader_service";
import { debugService } from "@point_of_sale/app/debug/debug_service";
import { hardwareProxyService } from "@point_of_sale/app/hardware_proxy/hardware_proxy_service";
import { popupService } from "@point_of_sale/app/popup/popup_service";
import { numberBufferService } from "@point_of_sale/app/utils/number_buffer_service";
import { notificationService } from "@point_of_sale/app/notification/notification_service";
import { posBusService } from "@point_of_sale/app/bus/pos_bus_service";
import { customerDisplayService } from "@point_of_sale/app/customer_display/customer_display_service";
import { reportService } from "@point_of_sale/app/utils/report_service";
import { soundService } from "@point_of_sale/app/sound/sound_service";
export interface Services {
barcode_reader: Resolved<ReturnType<typeof barcodeReaderService.start>>;
debug: ReturnType<typeof barcodeReaderService.start>;
hardware_proxy: ReturnType<typeof hardwareProxyService.start>;
popup: ReturnType<typeof popupService.start>;
number_buffer: ReturnType<typeof numberBufferService.start>;
pos_notification: ReturnType<typeof notificationService.start>;
pos_bus: ReturnType<typeof posBusService.start>;
customer_display: ReturnType<typeof customerDisplayService.start>;
report: ReturnType<typeof reportService.start>;
sound: ReturnType<typeof soundService.start>;
}
}
@@ -3,8 +3,8 @@
import { registry } from "@web/core/registry";
import { Mutex } from "@web/core/utils/concurrency";
import { session } from "@web/session";
import { ErrorPopup } from "@point_of_sale/js/Popups/ErrorPopup";
import { ErrorBarcodePopup } from "@point_of_sale/js/Popups/ErrorBarcodePopup";
import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup";
import { ErrorBarcodePopup } from "@point_of_sale/app/barcode/error_popup/barcode_error_popup";
import { BarcodeParser } from "@barcodes/js/barcode_parser";
export class BarcodeReader {
@@ -1,6 +1,6 @@
/** @odoo-module */
import { ErrorPopup } from "@point_of_sale/js/Popups/ErrorPopup";
import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup";
import { _lt } from "@web/core/l10n/translation";
export class ErrorBarcodePopup extends ErrorPopup {
@@ -1,7 +1,6 @@
/** @odoo-module */
import { batched } from "@point_of_sale/js/utils";
import { effect, Reactive } from "@point_of_sale/utils";
import { batched, effect, Reactive } from "@point_of_sale/utils";
import { registry } from "@web/core/registry";
import { pick } from "@web/core/utils/objects";
@@ -2,10 +2,10 @@
import { reactive } from "@odoo/owl";
import { registry } from "@web/core/registry";
import { DebugWidget } from "./debug_widget";
import { withComputedProperties } from "@point_of_sale/utils";
import { DebugWidget } from "@point_of_sale/app/debug/debug_widget";
const debugService = {
export const debugService = {
/**
* @param {{ debug: string }} env
*/
@@ -2,13 +2,13 @@
import { parseFloat } from "@web/views/fields/parsers";
import { Transition } from "@web/core/transition";
import { constrain, getLimits, useMovable } from "@point_of_sale/app/movable_hook";
import { ConfirmPopup } from "@point_of_sale/js/Popups/ConfirmPopup";
import { OrderImportPopup } from "@point_of_sale/js/Popups/OrderImportPopup";
import { constrain, getLimits, useMovable } from "@point_of_sale/app/utils/movable_hook";
import { ConfirmPopup } from "@point_of_sale/app/utils/confirm_popup/confirm_popup";
import { OrderImportPopup } from "@point_of_sale/app/debug/order_import_popup/order_import_popup";
import { useBus, useService } from "@web/core/utils/hooks";
import { useEffect, useRef, useState, Component } from "@odoo/owl";
import { usePos } from "../pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
export class DebugWidget extends Component {
static components = { Transition };
@@ -1,6 +1,6 @@
/** @odoo-module */
import { AbstractAwaitablePopup } from "@point_of_sale/js/Popups/AbstractAwaitablePopup";
import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup";
import { _lt } from "@web/core/l10n/translation";
export class OrderImportPopup extends AbstractAwaitablePopup {
@@ -3,9 +3,9 @@
import { registry } from "@web/core/registry";
import { odooExceptionTitleMap } from "@web/core/errors/error_dialogs";
import { ConnectionLostError, RPCError } from "@web/core/network/rpc_service";
import { ErrorPopup } from "@point_of_sale/js/Popups/ErrorPopup";
import { ErrorTracebackPopup } from "@point_of_sale/js/Popups/ErrorTracebackPopup";
import { OfflineErrorPopup } from "@point_of_sale/js/Popups/OfflineErrorPopup";
import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup";
import { ErrorTracebackPopup } from "@point_of_sale/app/errors/popups/error_traceback_popup";
import { OfflineErrorPopup } from "@point_of_sale/app/errors/popups/offline_error_popup";
import { _t } from "@web/core/l10n/translation";
export function identifyError(error) {
@@ -1,8 +1,9 @@
/** @odoo-module */
import { AbstractAwaitablePopup } from "@point_of_sale/js/Popups/AbstractAwaitablePopup";
import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup";
import { _lt } from "@web/core/l10n/translation";
import { useService } from "@web/core/utils/hooks";
import { onMounted } from "@odoo/owl";
// formerly ErrorPopupWidget
export class ErrorPopup extends AbstractAwaitablePopup {
@@ -16,7 +17,7 @@ export class ErrorPopup extends AbstractAwaitablePopup {
setup() {
super.setup();
owl.onMounted(this.onMounted);
onMounted(this.onMounted);
this.sound = useService("sound");
}
onMounted() {
@@ -1,8 +1,8 @@
/** @odoo-module */
import { ErrorPopup } from "@point_of_sale/js/Popups/ErrorPopup";
import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup";
import { _lt } from "@web/core/l10n/translation";
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
// formerly ErrorTracebackPopupWidget
export class ErrorTracebackPopup extends ErrorPopup {
@@ -1,7 +1,7 @@
/** @odoo-module */
import { usePos } from "@point_of_sale/app/pos_hook";
import { ErrorPopup } from "@point_of_sale/js/Popups/ErrorPopup";
import { usePos } from "@point_of_sale/app/store/pos_hook";
import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup";
import { _lt } from "@web/core/l10n/translation";
/**
@@ -1,11 +1,10 @@
/** @odoo-module */
import { HWPrinter } from "../printer/hw_printer";
import { HWPrinter } from "@point_of_sale/app/printer/hw_printer";
import { EventBus, reactive } from "@odoo/owl";
import { browser } from "@web/core/browser/browser";
import { registry } from "@web/core/registry";
import { effect } from "@point_of_sale/utils";
import { deduceUrl } from "@point_of_sale/js/utils";
import { effect, deduceUrl } from "@point_of_sale/utils";
/**
* This object interfaces with the local proxy to communicate to the various hardware devices
+1 -1
View File
@@ -1,6 +1,6 @@
/** @odoo-module */
import { Chrome } from "@point_of_sale/js/Chrome";
import { Chrome } from "@point_of_sale/app/pos_app";
import { Loader } from "@point_of_sale/app/loader/loader";
import { setLoadXmlDefaultApp, templates } from "@web/core/assets";
import { App, mount, reactive, whenReady } from "@odoo/owl";
@@ -2,7 +2,7 @@
import { Component, useState } from "@odoo/owl";
import { useService } from "@web/core/utils/hooks";
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
export class BackButton extends Component {
static template = "BackButton";
@@ -6,10 +6,10 @@ import { renderToElement } from "@web/core/utils/render";
import { useAutofocus, useService } from "@web/core/utils/hooks";
import { parseFloat, InvalidNumberError } from "@web/views/fields/parsers";
import { useState } from "@odoo/owl";
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
import { AbstractAwaitablePopup } from "@point_of_sale/js/Popups/AbstractAwaitablePopup";
import { ErrorPopup } from "@point_of_sale/js/Popups/ErrorPopup";
import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup";
import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup";
export class CashMovePopup extends AbstractAwaitablePopup {
static template = "point_of_sale.CashMovePopup";
@@ -1,7 +1,7 @@
/** @odoo-module */
import { Component, useState } from "@odoo/owl";
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
import { useService } from "@web/core/utils/hooks";
// Previously UsernameWidget
@@ -1,17 +1,17 @@
/** @odoo-module */
import { AbstractAwaitablePopup } from "@point_of_sale/js/Popups/AbstractAwaitablePopup";
import { SaleDetailsButton } from "../ChromeWidgets/SaleDetailsButton";
import { ConfirmPopup } from "./ConfirmPopup";
import { MoneyDetailsPopup } from "./MoneyDetailsPopup";
import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup";
import { SaleDetailsButton } from "@point_of_sale/app/navbar/sale_details_button/sale_details_button";
import { ConfirmPopup } from "@point_of_sale/app/utils/confirm_popup/confirm_popup";
import { MoneyDetailsPopup } from "@point_of_sale/app/utils/money_details_popup/money_details_popup";
import { useService } from "@web/core/utils/hooks";
import { AlertPopup } from "./AlertPopup";
import { ErrorPopup } from "./ErrorPopup";
import { AlertPopup } from "@point_of_sale/app/utils/alert_popup/alert_popup";
import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup";
import { useState } from "@odoo/owl";
import { ConnectionLostError } from "@web/core/network/rpc_service";
import { identifyError } from "@point_of_sale/app/error_handlers/error_handlers";
import { identifyError } from "@point_of_sale/app/errors/error_handlers";
import { _t } from "@web/core/l10n/translation";
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
import { sprintf } from "@web/core/utils/strings";
export class ClosePosPopup extends AbstractAwaitablePopup {
@@ -2,7 +2,7 @@
import { Component, useState } from "@odoo/owl";
import { useService } from "@web/core/utils/hooks";
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
import { _t } from "@web/core/l10n/translation";
export class CustomerFacingDisplayButton extends Component {
@@ -1,18 +1,18 @@
/** @odoo-module */
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
import { useService } from "@web/core/utils/hooks";
import { CashierName } from "@point_of_sale/js/ChromeWidgets/CashierName";
import { CustomerFacingDisplayButton } from "@point_of_sale/js/ChromeWidgets/CustomerFacingDisplayButton";
import { ProxyStatus } from "@point_of_sale/js/ChromeWidgets/ProxyStatus";
import { SaleDetailsButton } from "@point_of_sale/js/ChromeWidgets/SaleDetailsButton";
import { SyncNotification } from "@point_of_sale/js/ChromeWidgets/SyncNotification";
import { CashMovePopup } from "./cash_move_popup/cash_move_popup";
import { TicketScreen } from "@point_of_sale/js/Screens/TicketScreen/TicketScreen";
import { BackButton } from "@point_of_sale/app/navbar/BackButton";
import { CashierName } from "@point_of_sale/app/navbar/cashier_name/cashier_name";
import { CustomerFacingDisplayButton } from "@point_of_sale/app/navbar/customer_facing_display_button/customer_facing_display_button";
import { ProxyStatus } from "@point_of_sale/app/navbar/proxy_status/proxy_status";
import { SaleDetailsButton } from "@point_of_sale/app/navbar/sale_details_button/sale_details_button";
import { SyncNotification } from "@point_of_sale/app/navbar/sync_notification/sync_notification";
import { CashMovePopup } from "@point_of_sale/app/navbar/cash_move_popup/cash_move_popup";
import { TicketScreen } from "@point_of_sale/app/screens/ticket_screen/ticket_screen";
import { BackButton } from "@point_of_sale/app/navbar/back_button/back_button";
import { Component, useState, useExternalListener } from "@odoo/owl";
import { ClosePosPopup } from "@point_of_sale/js/Popups/ClosePosPopup";
import { ClosePosPopup } from "@point_of_sale/app/navbar/closing_popup/closing_popup";
import { _t } from "@web/core/l10n/translation";
export class Navbar extends Component {
@@ -1,7 +1,7 @@
/** @odoo-module */
import { Component, useState } from "@odoo/owl";
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
import { useService } from "@web/core/utils/hooks";
import { _t } from "@web/core/l10n/translation";
@@ -2,9 +2,9 @@
import { useService } from "@web/core/utils/hooks";
import { renderToElement } from "@web/core/utils/render";
import { ErrorPopup } from "../Popups/ErrorPopup";
import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup";
import { Component } from "@odoo/owl";
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
export class SaleDetailsButton extends Component {
static template = "SaleDetailsButton";
@@ -1,7 +1,7 @@
/** @odoo-module */
import { Component } from "@odoo/owl";
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
export class SyncNotification extends Component {
static template = "SyncNotification";
@@ -3,12 +3,12 @@
/**
* Implement this interface to support a new payment method in the POS:
*
* import { PaymentInterface } from "@point_of_sale/js/payment";
* import { PaymentInterface } from "@point_of_sale/app/payment/payment_interface";
* class MyPayment extends PaymentInterface {}
*
* To connect the interface to the right payment methods register it:
*
* import { register_payment_method } models from "@point_of_sale/js/models";
* import { register_payment_method } models from "@point_of_sale/app/store/models";
* register_payment_method('my_payment', MyPayment);
*
* my_payment is the technical name of the added selection in
@@ -5,7 +5,7 @@ import { Transition } from "@web/core/transition";
import { MainComponentsContainer } from "@web/core/main_components_container";
import { ErrorHandler } from "@web/core/utils/components";
import { Navbar } from "@point_of_sale/app/navbar/navbar";
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
import { reactive, Component, onMounted } from "@odoo/owl";
/**
@@ -2,10 +2,10 @@
import { _t } from "@web/core/l10n/translation";
import { getDataURLFromFile } from "@web/core/utils/urls";
import { ErrorPopup } from "@point_of_sale/js/Popups/ErrorPopup";
import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup";
import { useService } from "@web/core/utils/hooks";
import { Component } from "@odoo/owl";
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
export class PartnerDetailsEdit extends Component {
static template = "PartnerDetailsEdit";
@@ -4,9 +4,9 @@ import { registry } from "@web/core/registry";
import { debounce } from "@web/core/utils/timing";
import { useService } from "@web/core/utils/hooks";
import { PartnerLine } from "./PartnerLine";
import { PartnerDetailsEdit } from "./PartnerDetailsEdit";
import { usePos } from "@point_of_sale/app/pos_hook";
import { PartnerLine } from "@point_of_sale/app/screens/partner_list/partner_line/partner_line";
import { PartnerDetailsEdit } from "@point_of_sale/app/screens/partner_list/partner_editor/partner_editor";
import { usePos } from "@point_of_sale/app/store/pos_hook";
import { Component, onWillUnmount, useRef, useState } from "@odoo/owl";
import { sprintf } from "@web/core/utils/strings";
@@ -1,6 +1,6 @@
/** @odoo-module */
import { PSNumpadInputButton } from "./PSNumpadInputButton";
import { PSNumpadInputButton } from "@point_of_sale/app/screens/payment_screen/numpad/numpad_button/numpad_button";
import { Component } from "@odoo/owl";
import { useService } from "@web/core/utils/hooks";
@@ -1,9 +1,9 @@
/** @odoo-module */
import { NumberPopup } from "@point_of_sale/js/Popups/NumberPopup";
import { NumberPopup } from "@point_of_sale/app/utils/input_popups/number_popup";
import { useService } from "@web/core/utils/hooks";
import { Component, useState } from "@odoo/owl";
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
export class PaymentScreenPaymentLines extends Component {
static template = "PaymentScreenPaymentLines";
@@ -1,20 +1,20 @@
/** @odoo-module */
import { parseFloat } from "@web/views/fields/parsers";
import { useErrorHandlers } from "@point_of_sale/js/custom_hooks";
import { useErrorHandlers } from "@point_of_sale/app/utils/hooks";
import { registry } from "@web/core/registry";
import { useService } from "@web/core/utils/hooks";
import { floatIsZero } from "@web/core/utils/numbers";
import { ErrorPopup } from "@point_of_sale/js/Popups/ErrorPopup";
import { NumberPopup } from "@point_of_sale/js/Popups/NumberPopup";
import { DatePickerPopup } from "@point_of_sale/js/Popups/DatePickerPopup";
import { ConfirmPopup } from "@point_of_sale/js/Popups/ConfirmPopup";
import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup";
import { NumberPopup } from "@point_of_sale/app/utils/input_popups/number_popup";
import { DatePickerPopup } from "@point_of_sale/app/utils/date_picker_popup/date_picker_popup";
import { ConfirmPopup } from "@point_of_sale/app/utils/confirm_popup/confirm_popup";
import { PaymentScreenNumpad } from "./PaymentScreenNumpad";
import { PaymentScreenPaymentLines } from "./PaymentScreenPaymentLines";
import { PaymentScreenStatus } from "./PaymentScreenStatus";
import { usePos } from "@point_of_sale/app/pos_hook";
import { PaymentScreenNumpad } from "@point_of_sale/app/screens/payment_screen/numpad/numpad";
import { PaymentScreenPaymentLines } from "@point_of_sale/app/screens/payment_screen/payment_lines/payment_lines";
import { PaymentScreenStatus } from "@point_of_sale/app/screens/payment_screen/payment_status/payment_status";
import { usePos } from "@point_of_sale/app/store/pos_hook";
import { Component, useState } from "@odoo/owl";
import { sprintf } from "@web/core/utils/strings";
@@ -1,6 +1,6 @@
/** @odoo-module */
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
import { Component, useState } from "@odoo/owl";
import { useService } from "@web/core/utils/hooks";
@@ -1,6 +1,6 @@
/** @odoo-module */
import { AbstractAwaitablePopup } from "@point_of_sale/js/Popups/AbstractAwaitablePopup";
import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup";
import { _lt } from "@web/core/l10n/translation";
export class ControlButtonPopup extends AbstractAwaitablePopup {
@@ -1,7 +1,7 @@
/** @odoo-module */
import { usePos } from "@point_of_sale/app/pos_hook";
import { ProductScreen } from "@point_of_sale/js/Screens/ProductScreen/ProductScreen";
import { usePos } from "@point_of_sale/app/store/pos_hook";
import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen";
import { Component } from "@odoo/owl";
export class CustomerButton extends Component {
@@ -1,10 +1,10 @@
/** @odoo-module */
import { ProductScreen } from "@point_of_sale/js/Screens/ProductScreen/ProductScreen";
import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen";
import { useService } from "@web/core/utils/hooks";
import { TextAreaPopup } from "@point_of_sale/js/Popups/TextAreaPopup";
import { TextAreaPopup } from "@point_of_sale/app/utils/input_popups/textarea_popup";
import { Component } from "@odoo/owl";
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
export class OrderlineCustomerNoteButton extends Component {
static template = "OrderlineCustomerNoteButton";
@@ -1,10 +1,10 @@
/** @odoo-module */
import { ProductScreen } from "@point_of_sale/js/Screens/ProductScreen/ProductScreen";
import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen";
import { useService } from "@web/core/utils/hooks";
import { SelectionPopup } from "@point_of_sale/js/Popups/SelectionPopup";
import { SelectionPopup } from "@point_of_sale/app/utils/input_popups/selection_popup";
import { Component } from "@odoo/owl";
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
export class SetFiscalPositionButton extends Component {
static template = "SetFiscalPositionButton";
@@ -1,10 +1,10 @@
/** @odoo-module */
import { ProductScreen } from "@point_of_sale/js/Screens/ProductScreen/ProductScreen";
import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen";
import { useService } from "@web/core/utils/hooks";
import { SelectionPopup } from "@point_of_sale/js/Popups/SelectionPopup";
import { SelectionPopup } from "@point_of_sale/app/utils/input_popups/selection_popup";
import { Component } from "@odoo/owl";
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
export class SetPricelistButton extends Component {
static template = "SetPricelistButton";
@@ -1,10 +1,10 @@
/** @odoo-module */
import { ProductScreen } from "@point_of_sale/js/Screens/ProductScreen/ProductScreen";
import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen";
import { useService } from "@web/core/utils/hooks";
import { ProductInfoPopup } from "@point_of_sale/js/Popups/ProductInfoPopup";
import { ProductInfoPopup } from "@point_of_sale/app/screens/product_screen/product_info_popup/product_info_popup";
import { Component } from "@odoo/owl";
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
export class ProductInfoButton extends Component {
static template = "ProductInfoButton";
@@ -1,7 +1,7 @@
/** @odoo-module */
import { usePos } from "@point_of_sale/app/pos_hook";
import { ProductScreen } from "@point_of_sale/js/Screens/ProductScreen/ProductScreen";
import { usePos } from "@point_of_sale/app/store/pos_hook";
import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen";
import { Component } from "@odoo/owl";
export class RefundButton extends Component {
@@ -1,8 +1,8 @@
/** @odoo-module */
import { Component } from "@odoo/owl";
import { usePos } from "@point_of_sale/app/pos_hook";
import { ProductScreen } from "@point_of_sale/js/Screens/ProductScreen/ProductScreen";
import { usePos } from "@point_of_sale/app/store/pos_hook";
import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen";
import { useService } from "@web/core/utils/hooks";
export class SaveButton extends Component {
@@ -2,7 +2,7 @@
import { useService } from "@web/core/utils/hooks";
import { Component } from "@odoo/owl";
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
/**
* @prop {'quantity' | 'price' | 'discount'} activeMode
@@ -1,12 +1,12 @@
/** @odoo-module */
import { useService } from "@web/core/utils/hooks";
import { EditListPopup } from "@point_of_sale/js/Popups/EditListPopup";
import { EditListPopup } from "@point_of_sale/app/store/select_lot_popup/select_lot_popup";
import { Orderline } from "./Orderline";
import { OrderSummary } from "./OrderSummary";
import { Orderline } from "@point_of_sale/app/screens/product_screen/orderline/orderline";
import { OrderSummary } from "@point_of_sale/app/screens/product_screen/order_summary/order_summary";
import { Component, useEffect, useRef } from "@odoo/owl";
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
export class OrderWidget extends Component {
static components = { Orderline, OrderSummary };
@@ -1,7 +1,7 @@
/** @odoo-module */
import { Component } from "@odoo/owl";
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
import { floatIsZero } from "@web/core/utils/numbers";
export class OrderSummary extends Component {
@@ -1,7 +1,7 @@
/** @odoo-module */
import { Component } from "@odoo/owl";
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
export class Orderline extends Component {
static template = "Orderline";
@@ -1,7 +1,7 @@
/** @odoo-module */
import { Component } from "@odoo/owl";
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
export class ProductItem extends Component {
static template = "ProductItem";
@@ -1,7 +1,7 @@
/** @odoo-module */
import { AbstractAwaitablePopup } from "@point_of_sale/js/Popups/AbstractAwaitablePopup";
import { usePos } from "@point_of_sale/app/pos_hook";
import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup";
import { usePos } from "@point_of_sale/app/store/pos_hook";
/**
* Props:
@@ -1,9 +1,9 @@
/** @odoo-module */
import { debounce } from "@web/core/utils/timing";
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
import { CategoryButton } from "./CategoryButton";
import { CategoryButton } from "@point_of_sale/app/screens/product_screen/category_button/category_button";
import { Component, onMounted, onWillUnmount, useRef, useState } from "@odoo/owl";
import { useService } from "@web/core/utils/hooks";
@@ -1,15 +1,15 @@
/** @odoo-module */
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
import { useService } from "@web/core/utils/hooks";
import { identifyError } from "@point_of_sale/app/error_handlers/error_handlers";
import { identifyError } from "@point_of_sale/app/errors/error_handlers";
import { ConnectionLostError, ConnectionAbortedError } from "@web/core/network/rpc_service";
import { ProductItem } from "./ProductItem";
import { ProductsWidgetControlPanel } from "./ProductsWidgetControlPanel";
import { ProductItem } from "@point_of_sale/app/screens/product_screen/product/product";
import { ProductsWidgetControlPanel } from "@point_of_sale/app/screens/product_screen/product_list/control_panel/control_panel";
import { Component, useState } from "@odoo/owl";
import { sprintf } from "@web/core/utils/strings";
import { OfflineErrorPopup } from "@point_of_sale/js/Popups/OfflineErrorPopup";
import { OfflineErrorPopup } from "@point_of_sale/app/errors/popups/offline_error_popup";
export class ProductsWidget extends Component {
static components = { ProductItem, ProductsWidgetControlPanel };
@@ -1,25 +1,25 @@
/** @odoo-module */
import { ControlButtonsMixin } from "@point_of_sale/js/ControlButtonsMixin";
import { ControlButtonsMixin } from "@point_of_sale/app/utils/control_buttons_mixin";
import { registry } from "@web/core/registry";
import { useService } from "@web/core/utils/hooks";
import { useBarcodeReader } from "@point_of_sale/app/barcode_reader_hook";
import { useBarcodeReader } from "@point_of_sale/app/barcode/barcode_reader_hook";
import { parseFloat } from "@web/views/fields/parsers";
import { _lt } from "@web/core/l10n/translation";
import { NumberPopup } from "@point_of_sale/js/Popups/NumberPopup";
import { ErrorPopup } from "@point_of_sale/js/Popups/ErrorPopup";
import { ControlButtonPopup } from "@point_of_sale/js/Popups/ControlButtonPopup";
import { NumberPopup } from "@point_of_sale/app/utils/input_popups/number_popup";
import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup";
import { ControlButtonPopup } from "@point_of_sale/app/screens/product_screen/control_buttons/control_buttons_popup";
import { ConnectionLostError } from "@web/core/network/rpc_service";
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
import { Component, onMounted, useState, useRef } from "@odoo/owl";
import { ErrorBarcodePopup } from "@point_of_sale/js/Popups/ErrorBarcodePopup";
import { ErrorBarcodePopup } from "@point_of_sale/app/barcode/error_popup/barcode_error_popup";
import { NumpadWidget } from "./NumpadWidget";
import { OrderWidget } from "./OrderWidget";
import { ProductsWidget } from "./ProductsWidget";
import { ActionpadWidget } from "./ActionpadWidget";
import { NumpadWidget } from "@point_of_sale/app/screens/product_screen/numpad/numpad";
import { OrderWidget } from "@point_of_sale/app/screens/product_screen/order/order";
import { ProductsWidget } from "@point_of_sale/app/screens/product_screen/product_list/product_list";
import { ActionpadWidget } from "@point_of_sale/app/screens/product_screen/action_pad/action_pad";
export class ProductScreen extends ControlButtonsMixin(Component) {
static template = "ProductScreen";
@@ -1,8 +1,8 @@
/** @odoo-module */
import { useService } from "@web/core/utils/hooks";
import { ConfirmPopup } from "../Popups/ConfirmPopup";
import { ErrorPopup } from "../Popups/ErrorPopup";
import { ConfirmPopup } from "@point_of_sale/app/utils/confirm_popup/confirm_popup";
import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup";
import { Component, useRef } from "@odoo/owl";
/**
@@ -1,7 +1,7 @@
/** @odoo-module */
import { usePos } from "@point_of_sale/app/pos_hook";
import { WrappedProductNameLines } from "./WrappedProductNameLines";
import { usePos } from "@point_of_sale/app/store/pos_hook";
import { WrappedProductNameLines } from "@point_of_sale/app/screens/receipt_screen/receipt/wrapped_product_name";
import { Component, onWillUpdateProps } from "@odoo/owl";
export class OrderReceipt extends Component {
@@ -1,12 +1,12 @@
/** @odoo-module */
import { useErrorHandlers } from "@point_of_sale/js/custom_hooks";
import { AbstractReceiptScreen } from "@point_of_sale/js/Misc/AbstractReceiptScreen";
import { OfflineErrorPopup } from "@point_of_sale/js/Popups/OfflineErrorPopup";
import { useErrorHandlers } from "@point_of_sale/app/utils/hooks";
import { AbstractReceiptScreen } from "@point_of_sale/app/screens/receipt_screen/abstract_receipt_screen";
import { OfflineErrorPopup } from "@point_of_sale/app/errors/popups/offline_error_popup";
import { registry } from "@web/core/registry";
import { OrderReceipt } from "./OrderReceipt";
import { OrderReceipt } from "@point_of_sale/app/screens/receipt_screen/receipt/receipt";
import { onMounted, useRef, status, useState, onWillStart } from "@odoo/owl";
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
import { useService } from "@web/core/utils/hooks";
import { BasePrinter } from "@point_of_sale/app/printer/base_printer";
@@ -1,9 +1,9 @@
/** @odoo-module */
import { usePos } from "@point_of_sale/app/pos_hook";
import { AbstractReceiptScreen } from "@point_of_sale/js/Misc/AbstractReceiptScreen";
import { usePos } from "@point_of_sale/app/store/pos_hook";
import { AbstractReceiptScreen } from "@point_of_sale/app/screens/receipt_screen/abstract_receipt_screen";
import { registry } from "@web/core/registry";
import { OrderReceipt } from "../ReceiptScreen/OrderReceipt";
import { OrderReceipt } from "@point_of_sale/app/screens/receipt_screen/receipt/receipt";
export class ReprintReceiptScreen extends AbstractReceiptScreen {
static template = "ReprintReceiptScreen";
@@ -2,7 +2,7 @@
import { roundPrecision as round_pr } from "@web/core/utils/numbers";
import { registry } from "@web/core/registry";
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
import { Component, onMounted, onWillUnmount, useExternalListener, useState } from "@odoo/owl";
import { useService } from "@web/core/utils/hooks";
@@ -1,9 +1,9 @@
/** @odoo-module */
import { useService } from "@web/core/utils/hooks";
import { ErrorPopup } from "@point_of_sale/js/Popups/ErrorPopup";
import { ConfirmPopup } from "@point_of_sale/js/Popups/ConfirmPopup";
import { usePos } from "@point_of_sale/app/pos_hook";
import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup";
import { ConfirmPopup } from "@point_of_sale/app/utils/confirm_popup/confirm_popup";
import { usePos } from "@point_of_sale/app/store/pos_hook";
import { Component, useRef } from "@odoo/owl";
export class InvoiceButton extends Component {
@@ -1,6 +1,6 @@
/** @odoo-module */
import { OrderlineDetails } from "./OrderlineDetails";
import { OrderlineDetails } from "@point_of_sale/app/screens/ticket_screen/order_details/orderline_details";
import { Component } from "@odoo/owl";
/**
@@ -4,7 +4,7 @@ import { Component } from "@odoo/owl";
import { sprintf } from "@web/core/utils/strings";
import { formatFloat } from "@web/views/fields/formatters";
import { roundPrecision as round_pr } from "@web/core/utils/numbers";
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
/**
* @props {pos.order.line} line
@@ -1,6 +1,6 @@
/** @odoo-module */
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
import { Component } from "@odoo/owl";
export class ReprintReceiptButton extends Component {
@@ -1,22 +1,22 @@
/** @odoo-module */
import { Order } from "@point_of_sale/js/models";
import { Order } from "@point_of_sale/app/store/models";
import { registry } from "@web/core/registry";
import { useService } from "@web/core/utils/hooks";
import { deserializeDateTime } from "@web/core/l10n/dates";
import { parseFloat } from "@web/views/fields/parsers";
import { _lt } from "@web/core/l10n/translation";
import { ErrorPopup } from "@point_of_sale/js/Popups/ErrorPopup";
import { ConfirmPopup } from "@point_of_sale/js/Popups/ConfirmPopup";
import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup";
import { ConfirmPopup } from "@point_of_sale/app/utils/confirm_popup/confirm_popup";
import { ActionpadWidget } from "../ProductScreen/ActionpadWidget";
import { InvoiceButton } from "../TicketScreen/ControlButtons/InvoiceButton";
import { NumpadWidget } from "../ProductScreen/NumpadWidget";
import { OrderDetails } from "../TicketScreen/OrderDetails";
import { ReprintReceiptButton } from "./ControlButtons/ReprintReceiptButton";
import { SearchBar } from "../../Misc/SearchBar";
import { usePos } from "@point_of_sale/app/pos_hook";
import { ActionpadWidget } from "@point_of_sale/app/screens/product_screen/action_pad/action_pad";
import { InvoiceButton } from "@point_of_sale/app/screens/ticket_screen/invoice_button/invoice_button";
import { NumpadWidget } from "@point_of_sale/app/screens/product_screen/numpad/numpad";
import { OrderDetails } from "@point_of_sale/app/screens/ticket_screen/order_details/order_details";
import { ReprintReceiptButton } from "@point_of_sale/app/screens/ticket_screen/reprint_receipt_button/reprint_receipt_button";
import { SearchBar } from "@point_of_sale/app/screens/ticket_screen/search_bar/search_bar";
import { usePos } from "@point_of_sale/app/store/pos_hook";
import { Component, onMounted, useState } from "@odoo/owl";
import { sprintf } from "@web/core/utils/strings";
@@ -1,9 +1,9 @@
/** @odoo-module */
import { AbstractAwaitablePopup } from "@point_of_sale/js/Popups/AbstractAwaitablePopup";
import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup";
import { useAutofocus, useService } from "@web/core/utils/hooks";
import { usePos } from "@point_of_sale/app/pos_hook";
import { MoneyDetailsPopup } from "./MoneyDetailsPopup";
import { usePos } from "@point_of_sale/app/store/pos_hook";
import { MoneyDetailsPopup } from "@point_of_sale/app/utils/money_details_popup/money_details_popup";
import { useState } from "@odoo/owl";
import { _t } from "@web/core/l10n/translation";
@@ -1,9 +1,9 @@
/** @odoo-module */
/* global waitForWebfonts */
import { PosDB } from "@point_of_sale/js/db";
import { PosDB } from "@point_of_sale/app/store/db";
import { formatFloat } from "@web/views/fields/formatters";
import { uuidv4, batched, deduceUrl } from "@point_of_sale/js/utils";
import { uuidv4, batched, deduceUrl } from "@point_of_sale/utils";
import { HWPrinter } from "@point_of_sale/app/printer/hw_printer";
// FIXME POSREF - unify use of native parseFloat and web's parseFloat. We probably don't need the native version.
import { parseFloat as oParseFloat } from "@web/views/fields/parsers";
@@ -13,11 +13,11 @@ import {
roundPrecision as round_pr,
floatIsZero,
} from "@web/core/utils/numbers";
import { ErrorPopup } from "./Popups/ErrorPopup";
import { ProductConfiguratorPopup } from "@point_of_sale/js/Popups/ProductConfiguratorPopup";
import { EditListPopup } from "@point_of_sale/js/Popups/EditListPopup";
import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup";
import { ProductConfiguratorPopup } from "@point_of_sale/app/store/product_configurator_popup/product_configurator_popup";
import { EditListPopup } from "@point_of_sale/app/store/select_lot_popup/select_lot_popup";
import { markRaw, reactive } from "@odoo/owl";
import { ConfirmPopup } from "@point_of_sale/js/Popups/ConfirmPopup";
import { ConfirmPopup } from "@point_of_sale/app/utils/confirm_popup/confirm_popup";
import { sprintf } from "@web/core/utils/strings";
import { Mutex } from "@web/core/utils/concurrency";
import { memoize } from "@web/core/utils/functions";
@@ -4,7 +4,7 @@ import { useState } from "@odoo/owl";
import { useService } from "@web/core/utils/hooks";
/**
* @returns {import("./pos_store").PosStore}
* @returns {import("@point_of_sale/app/store/pos_store").PosStore}
*/
export function usePos() {
return useState(useService("pos"));
@@ -1,16 +1,16 @@
/** @odoo-module */
import { PosGlobalState } from "@point_of_sale/js/models";
import { PosGlobalState } from "@point_of_sale/app/store/models";
import { registry } from "@web/core/registry";
import { ConfirmPopup } from "@point_of_sale/js/Popups/ConfirmPopup";
import { ConfirmPopup } from "@point_of_sale/app/utils/confirm_popup/confirm_popup";
import { Reactive } from "@point_of_sale/utils";
import { ErrorPopup } from "@point_of_sale/js/Popups/ErrorPopup";
import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup";
import { _t } from "@web/core/l10n/translation";
import { CashOpeningPopup } from "@point_of_sale/js/Popups/CashOpeningPopup";
import { CashOpeningPopup } from "@point_of_sale/app/store/cash_opening_popup/cash_opening_popup";
import { sprintf } from "@web/core/utils/strings";
import { PaymentScreen } from "@point_of_sale/js/Screens/PaymentScreen/PaymentScreen";
import { ProductScreen } from "@point_of_sale/js/Screens/ProductScreen/ProductScreen";
import { PaymentScreen } from "@point_of_sale/app/screens/payment_screen/payment_screen";
import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen";
export class PosStore extends Reactive {
hasBigScrollBars = false;
@@ -1,5 +1,5 @@
/** @odoo-module */
import { AbstractAwaitablePopup } from "@point_of_sale/js/Popups/AbstractAwaitablePopup";
import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup";
import { Component, useRef, useState, useSubEnv } from "@odoo/owl";
import { useService } from "@web/core/utils/hooks";
@@ -1,10 +1,10 @@
/** @odoo-module */
import { AbstractAwaitablePopup } from "@point_of_sale/js/Popups/AbstractAwaitablePopup";
import { useAutoFocusToLast } from "@point_of_sale/js/custom_hooks";
import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup";
import { useAutoFocusToLast } from "@point_of_sale/app/utils/hooks";
import { _lt } from "@web/core/l10n/translation";
import { useState } from "@odoo/owl";
import { EditListInput } from "./EditListInput";
import { EditListInput } from "@point_of_sale/app/store/select_lot_popup/edit_list_input/edit_list_input";
/**
* Given a array of { id, text }, we show the user this popup to be able to modify this given array.
@@ -1,6 +1,6 @@
/** @odoo-module */
import { AbstractAwaitablePopup } from "@point_of_sale/js/Popups/AbstractAwaitablePopup";
import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup";
import { _lt } from "@web/core/l10n/translation";
export class AlertPopup extends AbstractAwaitablePopup {
@@ -1,6 +1,6 @@
/** @odoo-module */
import { AbstractAwaitablePopup } from "@point_of_sale/js/Popups/AbstractAwaitablePopup";
import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup";
import { _lt } from "@web/core/l10n/translation";
export class ConfirmPopup extends AbstractAwaitablePopup {
@@ -1,6 +1,6 @@
/** @odoo-module */
import { AbstractAwaitablePopup } from "@point_of_sale/js/Popups/AbstractAwaitablePopup";
import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup";
import { _lt } from "@web/core/l10n/translation";
import { onMounted, useRef, useState } from "@odoo/owl";
@@ -1,8 +1,8 @@
/** @odoo-module */
import { OfflineErrorPopup } from "./Popups/OfflineErrorPopup";
import { ConfirmPopup } from "./Popups/ConfirmPopup";
import { ErrorTracebackPopup } from "./Popups/ErrorTracebackPopup";
import { ErrorPopup } from "./Popups/ErrorPopup";
import { OfflineErrorPopup } from "@point_of_sale/app/errors/popups/offline_error_popup";
import { ConfirmPopup } from "@point_of_sale/app/utils/confirm_popup/confirm_popup";
import { ErrorTracebackPopup } from "@point_of_sale/app/errors/popups/error_traceback_popup";
import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup";
import { useEnv, onMounted, onPatched, useComponent, useRef } from "@odoo/owl";
/**
@@ -1,7 +1,7 @@
/** @odoo-module */
import { _t } from "@web/core/l10n/translation";
import { AbstractAwaitablePopup } from "@point_of_sale/js/Popups/AbstractAwaitablePopup";
import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup";
import { useService } from "@web/core/utils/hooks";
import { useState, useRef, onMounted } from "@odoo/owl";
@@ -1,6 +1,6 @@
/** @odoo-module */
import { AbstractAwaitablePopup } from "@point_of_sale/js/Popups/AbstractAwaitablePopup";
import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup";
import { _lt } from "@web/core/l10n/translation";
import { useState } from "@odoo/owl";
@@ -1,6 +1,6 @@
/** @odoo-module */
import { AbstractAwaitablePopup } from "@point_of_sale/js/Popups/AbstractAwaitablePopup";
import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup";
import { _lt } from "@web/core/l10n/translation";
import { onMounted, useRef, useState } from "@odoo/owl";
@@ -1,6 +1,6 @@
/** @odoo-module */
import { AbstractAwaitablePopup } from "@point_of_sale/js/Popups/AbstractAwaitablePopup";
import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup";
import { _lt } from "@web/core/l10n/translation";
import { onMounted, useRef, useState } from "@odoo/owl";
@@ -1,8 +1,8 @@
/** @odoo-module */
import { AbstractAwaitablePopup } from "@point_of_sale/js/Popups/AbstractAwaitablePopup";
import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup";
import { useState } from "@odoo/owl";
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
import { floatIsZero } from "@web/core/utils/numbers";
export class MoneyDetailsPopup extends AbstractAwaitablePopup {
@@ -1,56 +0,0 @@
/** @odoo-module */
/**
* Creates a batched version of a callback so that all calls to it in the same
* microtick will only call the original callback once.
*
* @param callback the callback to batch
* @returns a batched version of the original callback
*/
export function batched(callback) {
let called = false;
return async (...args) => {
// This await blocks all calls to the callback here, then releases them sequentially
// in the next microtick. This line decides the granularity of the batch.
await Promise.resolve();
if (!called) {
called = true;
// so that only the first call to the batched function calls the original callback.
// Schedule this before calling the callback so that calls to the batched function
// within the callback will proceed only after resetting called to false, and have
// a chance to execute the callback again
Promise.resolve().then(() => (called = false));
callback(...args);
}
};
}
/*
* comes from o_spreadsheet.js
* https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript
* */
export function uuidv4() {
// mainly for jest and other browsers that do not have the crypto functionality
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
const r = (Math.random() * 16) | 0,
v = c == "x" ? r : (r & 0x3) | 0x8;
return v.toString(16);
});
}
/**
* Formats the given `url` with correct protocol and port.
* Useful for communicating to local iot box instance.
* @param {string} url
* @returns {string}
*/
export function deduceUrl(url) {
const { protocol } = window.location;
if (!url.includes("//")) {
url = `${protocol}//${url}`;
}
if (url.indexOf(":", 6) < 0) {
url += ":" + (protocol === "https:" ? 443 : 8069);
}
return url;
}
+55
View File
@@ -47,3 +47,58 @@ export class Reactive {
return reactive(this);
}
}
/**
* Creates a batched version of a callback so that all calls to it in the same
* microtick will only call the original callback once.
*
* @param callback the callback to batch
* @returns a batched version of the original callback
*/
export function batched(callback) {
let called = false;
return async (...args) => {
// This await blocks all calls to the callback here, then releases them sequentially
// in the next microtick. This line decides the granularity of the batch.
await Promise.resolve();
if (!called) {
called = true;
// so that only the first call to the batched function calls the original callback.
// Schedule this before calling the callback so that calls to the batched function
// within the callback will proceed only after resetting called to false, and have
// a chance to execute the callback again
Promise.resolve().then(() => (called = false));
callback(...args);
}
};
}
/*
* comes from o_spreadsheet.js
* https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript
* */
export function uuidv4() {
// mainly for jest and other browsers that do not have the crypto functionality
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
const r = (Math.random() * 16) | 0,
v = c == "x" ? r : (r & 0x3) | 0x8;
return v.toString(16);
});
}
/**
* Formats the given `url` with correct protocol and port.
* Useful for communicating to local iot box instance.
* @param {string} url
* @returns {string}
*/
export function deduceUrl(url) {
const { protocol } = window.location;
if (!url.includes("//")) {
url = `${protocol}//${url}`;
}
if (url.indexOf(":", 6) < 0) {
url += ":" + (protocol === "https:" ? 443 : 8069);
}
return url;
}
@@ -5,7 +5,7 @@
* -----
*
* ```
* import const { startSteps, getSteps, createTourMethods } from "@point_of_sale/js/utils";
* import const { startSteps, getSteps, createTourMethods } from "@point_of_sale/utils";
* import const { Other } from "@point_of_sale/../tests/OtherMethods";
*
* // 1. Define classes Do, Check and Execute having methods that
@@ -3,7 +3,7 @@
import testUtils from "web.test_utils";
import { mount } from "@web/../tests/helpers/utils";
import { useService } from "@web/core/utils/hooks";
import { numberBufferService } from "@point_of_sale/app/number_buffer_service";
import { numberBufferService } from "@point_of_sale/app/utils/number_buffer_service";
import { registry } from "@web/core/registry";
import { makeTestEnv } from "@web/../tests/helpers/mock_env";
@@ -1,6 +1,6 @@
/** @odoo-module */
import { AbstractAwaitablePopup } from "@point_of_sale/js/Popups/AbstractAwaitablePopup";
import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup";
import makeTestEnvironment from "web.test_env";
import { click, getFixture, mount, nextTick, triggerEvent } from "@web/../tests/helpers/utils";
import { clearRegistryWithCleanup, makeTestEnv } from "@web/../tests/helpers/mock_env";
@@ -1,11 +1,11 @@
/** @odoo-module */
import { Chrome } from "@point_of_sale/js/Chrome";
import { Chrome } from "@point_of_sale/app/pos_app";
import { getFixture, mount } from "@web/../tests/helpers/utils";
import { makeTestEnv } from "@web/../tests/helpers/mock_env";
import { registry } from "@web/core/registry";
import { posService } from "@point_of_sale/app/pos_store";
import { numberBufferService } from "@point_of_sale/app/number_buffer_service";
import { barcodeReaderService } from "@point_of_sale/app/barcode_reader_service";
import { posService } from "@point_of_sale/app/store/pos_store";
import { numberBufferService } from "@point_of_sale/app/utils/number_buffer_service";
import { barcodeReaderService } from "@point_of_sale/app/barcode/barcode_reader_service";
import { EventBus } from "@odoo/owl";
import { uiService } from "@web/core/ui/ui_service";
@@ -1,6 +1,6 @@
/** @odoo-module */
import { PaymentScreen } from "@point_of_sale/js/Screens/PaymentScreen/PaymentScreen";
import { PaymentScreen } from "@point_of_sale/app/screens/payment_screen/payment_screen";
import { patch } from "@web/core/utils/patch";
import { onMounted } from "@odoo/owl";
@@ -16,9 +16,7 @@ patch(PaymentScreen.prototype, "pos_adyen.PaymentScreen", {
);
if (pendingPaymentLine) {
const paymentTerminal = pendingPaymentLine.payment_method.payment_terminal;
paymentTerminal.set_most_recent_service_id(
pendingPaymentLine.terminalServiceId
);
paymentTerminal.set_most_recent_service_id(pendingPaymentLine.terminalServiceId);
pendingPaymentLine.set_payment_status("waiting");
paymentTerminal.start_get_status_polling().then((isPaymentSuccessful) => {
if (isPaymentSuccessful) {
+1 -1
View File
@@ -1,5 +1,5 @@
/** @odoo-module */
import { register_payment_method, Payment } from "@point_of_sale/js/models";
import { register_payment_method, Payment } from "@point_of_sale/app/store/models";
import { PaymentAdyen } from "@pos_adyen/js/payment_adyen";
import { patch } from "@web/core/utils/patch";
@@ -1,8 +1,8 @@
/** @odoo-module */
import { _t } from "@web/core/l10n/translation";
import { PaymentInterface } from "@point_of_sale/js/payment";
import { ErrorPopup } from "@point_of_sale/js/Popups/ErrorPopup";
import { PaymentInterface } from "@point_of_sale/app/payment/payment_interface";
import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup";
import { sprintf } from "@web/core/utils/strings";
export class PaymentAdyen extends PaymentInterface {
@@ -1,12 +1,12 @@
/** @odoo-module */
import { ProductScreen } from "@point_of_sale/js/Screens/ProductScreen/ProductScreen";
import { ProductScreen } from "@point_of_sale/app/screens/product_screen/product_screen";
import { useService } from "@web/core/utils/hooks";
import { NumberPopup } from "@point_of_sale/js/Popups/NumberPopup";
import { ErrorPopup } from "@point_of_sale/js/Popups/ErrorPopup";
import { NumberPopup } from "@point_of_sale/app/utils/input_popups/number_popup";
import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup";
import { Component } from "@odoo/owl";
import { sprintf } from "@web/core/utils/strings";
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
export class DiscountButton extends Component {
static template = "DiscountButton";
@@ -1,6 +1,6 @@
/** @odoo-module */
import { PosGlobalState } from "@point_of_sale/js/models";
import { PosGlobalState } from "@point_of_sale/app/store/models";
import { EpsonPrinter } from "@pos_epson_printer/js/epson_printer";
import { patch } from "@web/core/utils/patch";
+1 -1
View File
@@ -1,7 +1,7 @@
/** @odoo-module */
import { Navbar } from "@point_of_sale/app/navbar/navbar";
import { HeaderLockButton } from "../js/HeaderLockButton";
import { HeaderLockButton } from "@pos_hr/js/HeaderLockButton";
import { patch } from "@web/core/utils/patch";
patch(Navbar, "pos_hr.Navbar", {
+1 -1
View File
@@ -1,7 +1,7 @@
/** @odoo-module */
import { patch } from "@web/core/utils/patch";
import { PosStore } from "@point_of_sale/app/pos_store";
import { PosStore } from "@point_of_sale/app/store/pos_store";
patch(PosStore.prototype, "pos_hr.PosStore", {
async setup() {
+1 -1
View File
@@ -1,6 +1,6 @@
/** @odoo-module */
import { CashierName } from "@point_of_sale/js/ChromeWidgets/CashierName";
import { CashierName } from "@point_of_sale/app/navbar/cashier_name/cashier_name";
import { patch } from "@web/core/utils/patch";
import { useCashierSelector } from "@pos_hr/js/SelectCashierMixin";
+1 -1
View File
@@ -1,6 +1,6 @@
/** @odoo-module */
import { Chrome } from "@point_of_sale/js/Chrome";
import { Chrome } from "@point_of_sale/app/pos_app";
import { patch } from "@web/core/utils/patch";
patch(Chrome.prototype, "pos_hr.Chrome", {
@@ -1,7 +1,7 @@
/** @odoo-module */
import { Component } from "@odoo/owl";
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
export class HeaderLockButton extends Component {
static template = "HeaderLockButton";
+1 -1
View File
@@ -2,7 +2,7 @@
import { useCashierSelector } from "@pos_hr/js/SelectCashierMixin";
import { registry } from "@web/core/registry";
import { usePos } from "@point_of_sale/app/pos_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
import { Component } from "@odoo/owl";
export class LoginScreen extends Component {
+1 -1
View File
@@ -1,6 +1,6 @@
/** @odoo-module */
import { PaymentScreen } from "@point_of_sale/js/Screens/PaymentScreen/PaymentScreen";
import { PaymentScreen } from "@point_of_sale/app/screens/payment_screen/payment_screen";
import { patch } from "@web/core/utils/patch";
patch(PaymentScreen.prototype, "pos_hr.PaymentScreen", {
@@ -3,12 +3,12 @@
import { _t } from "@web/core/l10n/translation";
import { NumberPopup } from "@point_of_sale/js/Popups/NumberPopup";
import { SelectionPopup } from "@point_of_sale/js/Popups/SelectionPopup";
import { ErrorPopup } from "@point_of_sale/js/Popups/ErrorPopup";
import { NumberPopup } from "@point_of_sale/app/utils/input_popups/number_popup";
import { SelectionPopup } from "@point_of_sale/app/utils/input_popups/selection_popup";
import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup";
import { useService } from "@web/core/utils/hooks";
import { useBarcodeReader } from "@point_of_sale/app/barcode_reader_hook";
import { usePos } from "@point_of_sale/app/pos_hook";
import { useBarcodeReader } from "@point_of_sale/app/barcode/barcode_reader_hook";
import { usePos } from "@point_of_sale/app/store/pos_hook";
export function useCashierSelector(
{ onCashierChanged, exclusive } = { onCashierChanged: () => {}, exclusive: false }

Some files were not shown because too many files have changed in this diff Show More