From 01ffba86955d681d71efef67e585fb516729e502 Mon Sep 17 00:00:00 2001 From: vlst Date: Wed, 12 Jul 2023 08:47:39 +0000 Subject: [PATCH] [REF] pos*: refactor pos screens pos*: point_of_sale,pos_hr,pos_loyalty,pos_restaurant, pos_sale, In this commit we refactor some parts of the pos ui with the interest of providing a simpler and cleaner codebase. One pattern that is heavily used in the pos ui is that in which views are changed based on the screen size at the component level. This means that it becomes very difficult to understand what parts of a specific template will be seen in mobile or in desktop views. In most cases, the pos adapts for mobile screens by using the same main components, but in different configurations. For example, a component that was visible in desktop mode, might become accesible through a menu in mobile mode. In order to improve the situation, the proposed solution is to separate the logical parts of the ui into `owl templates` and to inject this templates wherever the need arises. Thus, instead of constantly using `t-if="ui.isSmall"` in all places where there is a difference between the mobile and desktop views, we have a main conditional branch at the root level of the component representing a certain screen and then build 2 separate views, one for mobile and one for desktop, each calling the needed templates. In this commit we implement this pattern for the `payment_screen`. This will allow us to observe this pattern over a period of time, before implementing it on the other screens. In this commit we also: - add small fixes and improvements relating to the previous commit, in which the pos was refactored to bootstrap; - replace the `
` tags in the numpad component with the bootstrap grid system; - adapt the `cash_move_popup` to rely more on `t-model` and less on `t-on-change` Part-of: odoo/odoo#129544 Co-authored-by: vlst Co-authored-by: Xavier Luyckx (xlu) --- .../errors/popups/error_traceback_popup.xml | 33 +-- .../navbar/cash_move_popup/cash_move_popup.js | 12 +- .../cash_move_popup/cash_move_popup.scss | 0 .../cash_move_popup/cash_move_popup.xml | 24 +- .../navbar/closing_popup/closing_popup.xml | 35 +-- .../static/src/app/navbar/navbar.xml | 10 +- .../src/app/popup/popup_controller.scss | 23 -- .../static/src/app/popup/popup_controller.xml | 3 +- .../point_of_sale/static/src/app/pos_app.scss | 30 +-- .../point_of_sale/static/src/app/pos_app.xml | 26 +-- .../partner_editor/partner_editor.xml | 83 +++---- .../partner_list/partner_line/partner_line.js | 2 +- .../partner_line/partner_line.scss | 9 +- .../partner_line/partner_line.xml | 22 +- .../screens/partner_list/partner_list.scss | 5 +- .../app/screens/partner_list/partner_list.xml | 139 ++++++----- .../numpad/numpad_button/numpad_button.xml | 6 +- .../payment_lines/payment_lines.xml | 6 +- .../payment_screen/payment_screen.scss | 47 ---- .../screens/payment_screen/payment_screen.xml | 220 +++++++++--------- .../payment_status/payment_status.xml | 72 +++--- .../product_screen/action_pad/action_pad.xml | 4 +- .../control_buttons/control_buttons.scss | 8 +- .../customer_button/customer_button.xml | 3 +- .../pricelist_button/pricelist_button.xml | 4 +- .../screens/product_screen/numpad/numpad.scss | 37 +-- .../screens/product_screen/numpad/numpad.xml | 36 +-- .../screens/product_screen/order/order.scss | 8 - .../screens/product_screen/order/order.xml | 2 +- .../order_summary/order_summary.xml | 6 +- .../product_screen/orderline/orderline.scss | 15 +- .../product_screen/orderline/orderline.xml | 14 +- .../product_screen/product/product.scss | 20 +- .../product_screen/product/product.xml | 8 +- .../product_list/product_list.scss | 3 - .../screens/product_screen/product_screen.xml | 12 +- .../screens/receipt_screen/receipt_screen.xml | 2 +- .../receipt_screen/reprint_receipt_screen.xml | 4 +- .../app/screens/scale_screen/scale_screen.xml | 2 +- .../static/src/app/screens/screens.scss | 39 ---- .../order_details/order_details.xml | 8 +- .../order_details/orderline_details.xml | 12 +- .../ticket_screen/search_bar/search_bar.scss | 34 +++ .../ticket_screen/search_bar/search_bar.xml | 68 +++--- .../screens/ticket_screen/ticket_screen.scss | 178 ++------------ .../screens/ticket_screen/ticket_screen.xml | 10 +- .../product_configurator_popup.xml | 18 +- .../edit_list_input/edit_list_input.xml | 11 +- .../select_lot_popup/select_lot_popup.xml | 6 +- .../src/app/utils/alert_popup/alert_popup.xml | 14 +- .../src/app/utils/contextual_utils_service.js | 21 +- .../date_picker_popup/date_picker_popup.xml | 6 +- .../static/src/app/utils/hooks.js | 17 +- .../app/utils/input_popups/number_popup.xml | 78 ++++--- .../utils/input_popups/selection_popup.xml | 2 +- .../utils/input_popups/text_input_popup.xml | 6 +- .../app/utils/input_popups/textarea_popup.xml | 6 +- .../money_details_popup.scss | 3 - .../money_details_popup.xml | 8 +- .../src/css/popups/cash_opening_popup.css | 3 - .../src/css/popups/closing_pos_popup.scss | 11 +- .../static/src/css/popups/common.css | 22 -- .../src/css/popups/money_details_popup.css | 17 -- .../static/src/css/popups/popups.scss | 30 --- .../tests/tours/helpers/ChromeTourMethods.js | 2 +- .../src/app/login_screen/login_screen.xml | 6 +- .../static/src/app/select_cashier_mixin.js | 1 + addons/pos_hr/static/src/css/pos.scss | 4 +- .../reward_button/reward_button.xml | 2 +- .../order_summary/order_summary.xml | 39 ++-- .../src/app/bill_screen/bill_screen.xml | 4 +- .../static/src/app/floor_screen/edit_bar.xml | 2 +- .../src/app/floor_screen/editable_table.js | 4 +- .../src/app/floor_screen/editable_table.xml | 5 +- .../src/app/floor_screen/floor_screen.scss | 5 + .../src/app/floor_screen/floor_screen.xml | 6 +- .../static/src/app/floor_screen/table.js | 5 +- .../static/src/app/floor_screen/table.xml | 22 +- .../src/app/product_screen/order/order.xml | 2 +- .../split_bill_screen/split_bill_screen.xml | 2 +- .../split_orderline/split_orderline.xml | 4 +- .../static/src/app/tip_screen/tip_screen.xml | 2 +- .../payment_screen/payment_screen.xml | 18 +- .../product_screen/orderline/orderline.xml | 4 +- .../product_screen/product_screen.xml | 4 +- .../static/src/overrides/models/pos_store.js | 2 +- .../sale_order_management_screen.xml | 2 +- addons/pos_sale/static/src/css/pos_sale.css | 6 - .../product_screen/orderline/orderline.xml | 12 +- .../order_receipt/order_receipt.xml | 6 +- 90 files changed, 698 insertions(+), 1096 deletions(-) delete mode 100644 addons/point_of_sale/static/src/app/navbar/cash_move_popup/cash_move_popup.scss delete mode 100644 addons/point_of_sale/static/src/app/screens/product_screen/order/order.scss delete mode 100644 addons/point_of_sale/static/src/app/screens/screens.scss delete mode 100644 addons/point_of_sale/static/src/app/utils/money_details_popup/money_details_popup.scss delete mode 100644 addons/point_of_sale/static/src/css/popups/cash_opening_popup.css delete mode 100644 addons/point_of_sale/static/src/css/popups/common.css delete mode 100644 addons/point_of_sale/static/src/css/popups/money_details_popup.css delete mode 100644 addons/pos_sale/static/src/css/pos_sale.css diff --git a/addons/point_of_sale/static/src/app/errors/popups/error_traceback_popup.xml b/addons/point_of_sale/static/src/app/errors/popups/error_traceback_popup.xml index 26c5d3ed0a5..4617b420a2d 100644 --- a/addons/point_of_sale/static/src/app/errors/popups/error_traceback_popup.xml +++ b/addons/point_of_sale/static/src/app/errors/popups/error_traceback_popup.xml @@ -11,23 +11,24 @@
-