From 58607d1cf7e410de8a4ae8079e9aec95f6bd72ab Mon Sep 17 00:00:00 2001 From: Romain Derie Date: Wed, 4 Oct 2023 09:19:26 +0200 Subject: [PATCH] [REV] pos_self_order, product, website_sale: add product info popup This reverts commit 3b9401c35423574b57f1081f9c80bd149d79d76b. It shouldn't have been merged in the first place. The PR was `r-` but it seems like the mergebot bugged and still merged it because there was an occurence of `r+` in the sentence which asked robodoo to `r-`. > robodoo r- just to be sure, since there was a random r+ not [...] Rationale of the revert: - Bad field name: - "ecommerce" in product module - "ecommerce" but used in POS - Arguably very low value to share the field -> This field is used in ecommerce to add info exactly between the price and the name of a product. There is low chance that you want to share that exact information with the POS. - Technically, it couldn't work. What you design in website builder on the product page is related to website assets JS and CSS, which are not loaded neither in the backend and neither in the POS. It was leading to multiple critical issues, mainly: - Losing the whole style of the content (CSS) - Breaking completly the snippets (visually and design wise) (CSS/JS) - Not even show (JS is in charge of showing the content eg) Note that the same issues were already existing in that field in the backend (it's shown in the product form view). The ecommerce team was looking for a solution to make it work, but it's impossible as to work, it would need the website / frontend assets, which can't be loaded in the backend / POS. The cancel of this PR was validated with PO of POS and ecommerce following those explanation, which they weren't aware of. Apart from this revert, further PR will be done to: 1. Remove the field from the product form view (ecommerce app) 2. Create a new field for POS Revert of https://github.com/odoo/odoo/pull/136906 task-3524272 closes odoo/odoo#137514 Signed-off-by: Romain Derie (rde) --- addons/point_of_sale/views/product_view.xml | 3 --- addons/pos_self_order/__manifest__.py | 2 -- .../pos_self_order/models/product_product.py | 2 +- .../components/product_card/product_card.js | 9 --------- .../components/product_card/product_card.scss | 20 ------------------- .../components/product_card/product_card.xml | 3 --- .../product_info_popup/product_info_popup.js | 12 ----------- .../product_info_popup.scss | 6 ------ .../product_info_popup/product_info_popup.xml | 18 ----------------- .../static/src/app/models/product.js | 7 ++----- .../src/app/pages/combo_page/combo_page.xml | 4 ++-- .../product_list_page/product_list_page.xml | 2 +- .../app/pages/product_page/product_page.xml | 4 ++-- addons/product/models/product_template.py | 8 -------- addons/product/views/product_views.xml | 6 ------ .../website_sale/models/product_template.py | 7 +++++++ addons/website_sale/views/product_views.xml | 9 ++++++--- 17 files changed, 21 insertions(+), 101 deletions(-) delete mode 100644 addons/pos_self_order/static/src/app/components/product_info_popup/product_info_popup.js delete mode 100644 addons/pos_self_order/static/src/app/components/product_info_popup/product_info_popup.scss delete mode 100644 addons/pos_self_order/static/src/app/components/product_info_popup/product_info_popup.xml diff --git a/addons/point_of_sale/views/product_view.xml b/addons/point_of_sale/views/product_view.xml index a4a5ebf1163..c8b903db57e 100644 --- a/addons/point_of_sale/views/product_view.xml +++ b/addons/point_of_sale/views/product_view.xml @@ -94,9 +94,6 @@ detailed_type == "combo" - - 0 - diff --git a/addons/pos_self_order/__manifest__.py b/addons/pos_self_order/__manifest__.py index f66d0d64721..e86b49db248 100644 --- a/addons/pos_self_order/__manifest__.py +++ b/addons/pos_self_order/__manifest__.py @@ -64,8 +64,6 @@ 'web/static/lib/bootstrap/js/dist/scrollspy.js', "pos_self_order/static/src/app/**/*", "point_of_sale/static/src/app/store/models/product_custom_attribute.js", - 'web_editor/static/src/js/editor/odoo-editor/src/base_style.scss', - 'web_editor/static/src/scss/web_editor.common.scss', ], # Assets tests "pos_self_order.assets_tests": [ diff --git a/addons/pos_self_order/models/product_product.py b/addons/pos_self_order/models/product_product.py index f14fdfcb79d..7bdd490a7a1 100644 --- a/addons/pos_self_order/models/product_product.py +++ b/addons/pos_self_order/models/product_product.py @@ -117,7 +117,7 @@ class ProductProduct(models.Model): "attributes": self._get_attributes(pos_config), "name": self._get_name(), "id": self.id, - "description_ecommerce": self.description_ecommerce, + "description_sale": self.description_sale, "pos_categ_ids": self.pos_categ_ids.mapped("name") or ["Other"], "pos_combo_ids": self.combo_ids.mapped("id") or False, "is_pos_groupable": self.uom_id.is_pos_groupable, diff --git a/addons/pos_self_order/static/src/app/components/product_card/product_card.js b/addons/pos_self_order/static/src/app/components/product_card/product_card.js index 144c1e41c99..95dd5d420e9 100644 --- a/addons/pos_self_order/static/src/app/components/product_card/product_card.js +++ b/addons/pos_self_order/static/src/app/components/product_card/product_card.js @@ -4,7 +4,6 @@ import { Component, useRef } from "@odoo/owl"; import { useSelfOrder } from "@pos_self_order/app/self_order_service"; import { useService, useForwardRefToParent } from "@web/core/utils/hooks"; import { Line } from "@pos_self_order/app/models/line"; -import { ProductInfoPopup } from "@pos_self_order/app/components/product_info_popup/product_info_popup"; export class ProductCard extends Component { static template = "pos_self_order.ProductCard"; @@ -16,7 +15,6 @@ export class ProductCard extends Component { setup() { this.selfOrder = useSelfOrder(); this.router = useService("router"); - this.dialog = useService("dialog"); useForwardRefToParent("currentProductCard"); } @@ -111,11 +109,4 @@ export class ProductCard extends Component { await this.selfOrder.getPricesFromServer(); } } - - getProductInfo() { - this.dialog.add(ProductInfoPopup, { - product: this.props.product, - title: this.props.product.name, - }); - } } diff --git a/addons/pos_self_order/static/src/app/components/product_card/product_card.scss b/addons/pos_self_order/static/src/app/components/product_card/product_card.scss index d92c7b388e9..834a90b8e65 100644 --- a/addons/pos_self_order/static/src/app/components/product_card/product_card.scss +++ b/addons/pos_self_order/static/src/app/components/product_card/product_card.scss @@ -2,7 +2,6 @@ width: 100%; display:flex; flex-direction: column; - position: relative; .o_self_order_item_card_image { width: 100%; @@ -29,22 +28,3 @@ } } } - -.product-information-tag { - width: 0; - height: 0; - border-style: solid; - border-width: 0 40px 40px 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: 25px; - top: 4px; -} diff --git a/addons/pos_self_order/static/src/app/components/product_card/product_card.xml b/addons/pos_self_order/static/src/app/components/product_card/product_card.xml index 38e3eb2bf36..9e540b82f45 100644 --- a/addons/pos_self_order/static/src/app/components/product_card/product_card.xml +++ b/addons/pos_self_order/static/src/app/components/product_card/product_card.xml @@ -5,9 +5,6 @@