From 707d76eec1aa90a2ca892ca25529e09a2b5dfb08 Mon Sep 17 00:00:00 2001 From: "Adrien Guilliams (adgu)" Date: Thu, 21 Sep 2023 15:18:52 +0200 Subject: [PATCH] [IMP] pos*: Remove info button and add self ordering availability pos*: point_of_sale, pos_sale_product_configurator, pos_self_order This commit removes the product info button and put a button on each product card to open the product info popup. The commit also adds a new field on the product template model to track the availability of a product to the self ordering mode. This field can be changed from the product form view or from the product info popup directly in the POS. If the field is set to false, the product will not be shown in the self ordering mode. The commit also adds new filter and search fields on the product list view in the backend. closes odoo/odoo#136467 Task-id: 3515881 Signed-off-by: David Monnom (moda) --- .../product_card/product_card.js | 2 + .../product_card/product_card.scss | 19 +++++++ .../product_card/product_card.xml | 3 ++ .../product_info_button.js | 31 ----------- .../product_info_button.xml | 11 ---- .../product_info_popup/product_info_popup.xml | 10 ++-- .../product_list/product_list.js | 5 ++ .../product_list/product_list.xml | 2 + addons/point_of_sale/views/product_view.xml | 6 +++ .../product_info_button.js | 17 ------ .../product_info_button.xml | 8 --- .../product_info_popup/product_info_popup.xml | 6 +-- addons/pos_self_order/__manifest__.py | 4 ++ addons/pos_self_order/models/pos_config.py | 1 + addons/pos_self_order/models/pos_session.py | 5 ++ .../pos_self_order/models/product_product.py | 40 +++++++++++++- .../combo_selection/combo_selection.js | 3 ++ .../combo_selection/combo_selection.xml | 3 ++ .../components/product_card/product_card.js | 6 +-- .../components/product_card/product_card.xml | 9 +++- .../static/src/app/models/product.js | 2 + .../src/app/pages/cart_page/cart_page.js | 4 ++ .../src/app/pages/cart_page/cart_page.xml | 2 +- .../src/app/pages/combo_page/combo_page.js | 4 ++ .../src/app/pages/combo_page/combo_page.xml | 2 +- .../app/pages/product_page/product_page.js | 4 ++ .../app/pages/product_page/product_page.xml | 6 +-- .../static/src/app/self_order_bus_service.js | 6 +++ .../static/src/app/self_order_service.js | 52 +++++++++++++++++++ .../components/product_card/product_card.js | 15 ++++++ .../components/product_card/product_card.scss | 3 ++ .../components/product_card/product_card.xml | 8 +++ .../product_info_popup/product_info_popup.js | 18 +++++++ .../product_info_popup/product_info_popup.xml | 23 ++++++++ addons/pos_self_order/views/product_views.xml | 38 ++++++++++++++ 35 files changed, 291 insertions(+), 87 deletions(-) delete mode 100644 addons/point_of_sale/static/src/app/screens/product_screen/control_buttons/product_info_button/product_info_button.js delete mode 100644 addons/point_of_sale/static/src/app/screens/product_screen/control_buttons/product_info_button/product_info_button.xml delete mode 100644 addons/pos_sale_product_configurator/static/src/overrides/components/product_info_button/product_info_button.js delete mode 100644 addons/pos_sale_product_configurator/static/src/overrides/components/product_info_button/product_info_button.xml create mode 100644 addons/pos_self_order/static/src/overrides/components/product_card/product_card.js create mode 100644 addons/pos_self_order/static/src/overrides/components/product_card/product_card.scss create mode 100644 addons/pos_self_order/static/src/overrides/components/product_card/product_card.xml create mode 100644 addons/pos_self_order/static/src/overrides/components/product_info_popup/product_info_popup.js create mode 100644 addons/pos_self_order/static/src/overrides/components/product_info_popup/product_info_popup.xml create mode 100644 addons/pos_self_order/views/product_views.xml diff --git a/addons/point_of_sale/static/src/app/generic_components/product_card/product_card.js b/addons/point_of_sale/static/src/app/generic_components/product_card/product_card.js index 154d6da1d51..69f5e5119a3 100644 --- a/addons/point_of_sale/static/src/app/generic_components/product_card/product_card.js +++ b/addons/point_of_sale/static/src/app/generic_components/product_card/product_card.js @@ -10,7 +10,9 @@ export class ProductCard extends Component { productId: Number, price: String, imageUrl: String, + productInfo: { Boolean, optional: true }, onClick: { type: Function, optional: true }, + onProductInfoClick: { type: Function, optional: true }, }; static defaultProps = { onClick: () => {}, diff --git a/addons/point_of_sale/static/src/app/generic_components/product_card/product_card.scss b/addons/point_of_sale/static/src/app/generic_components/product_card/product_card.scss index 19c5280dbb5..b19c44f804b 100644 --- a/addons/point_of_sale/static/src/app/generic_components/product_card/product_card.scss +++ b/addons/point_of_sale/static/src/app/generic_components/product_card/product_card.scss @@ -24,3 +24,22 @@ box-shadow: 0 0 0 2px $primary; } } + +.product-information-tag { + width: 0; + height: 0; + border-style: solid; + border-width: 0 30px 30px 0; + border-color: transparent #9a9ea180 transparent transparent; + position: absolute; + top: 0; + right: 0; + color: white; + text-align: center; +} + +.product-information-tag-logo { + position: absolute; + left: 19px; + top: 3px; +} diff --git a/addons/point_of_sale/static/src/app/generic_components/product_card/product_card.xml b/addons/point_of_sale/static/src/app/generic_components/product_card/product_card.xml index 5f3eb855e4c..843acf436b0 100644 --- a/addons/point_of_sale/static/src/app/generic_components/product_card/product_card.xml +++ b/addons/point_of_sale/static/src/app/generic_components/product_card/product_card.xml @@ -8,6 +8,9 @@ t-on-click="props.onClick" t-att-data-product-id="props.productId" t-attf-aria-labelledby="article_product_{{props.productId}}"> +
+