From 2f6978268172e16c745effdedc272361b526bf01 Mon Sep 17 00:00:00 2001 From: "Loukas Wets (lowe)" Date: Tue, 1 Aug 2023 13:38:19 +0000 Subject: [PATCH] [FIX] pos_self_order: condition opening product window Nothing will happen if you click on a product without image, sale comment and attributes in selfOder if no table was selected before. To reproduce the issue: 1. Create a product without image, sale comment and attributes (Fill in product name, price, availible in pos) 2. Open a new selfOrder page (without a table selected) 3. Click on the product Issue: nothing happens, the product cannot be ordered. If no product meets at least one of the three conditions (image, sale comment or attributes), it will not be possible to select the table, and thus self-ordering will be impossible. In fact the table selection only happens during the first order. closes odoo/odoo#130614 X-original-commit: 186d60e57da5a5b0182131a936838821a01a7a5f Signed-off-by: Joseph Caburnay (jcb) --- .../src/components/product_card/product_card.js | 12 ------------ .../tests/tours/self_order_after_meal_cart_tour.js | 3 +++ 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/addons/pos_self_order/static/src/components/product_card/product_card.js b/addons/pos_self_order/static/src/components/product_card/product_card.js index cb2a4aa770b..da8439f9032 100644 --- a/addons/pos_self_order/static/src/components/product_card/product_card.js +++ b/addons/pos_self_order/static/src/components/product_card/product_card.js @@ -24,21 +24,9 @@ export class ProductCard extends Component { clickOnProduct() { const product = this.props.product; - if (!this.canOpenProductMainView(product)) { - return; - } this.router.navigate("product", { id: product.id }); } - canOpenProductMainView(product) { - return ( - this.selfOrder.table || - product.has_image || - product.description_sale || - product.attributes.length - ); - } - getQtyInCartString() { // FIXME need to implement price_extra const productId = this.props.line.product_id; diff --git a/addons/pos_self_order/static/tests/tours/self_order_after_meal_cart_tour.js b/addons/pos_self_order/static/tests/tours/self_order_after_meal_cart_tour.js index b02e24bdbda..e9248b71bea 100644 --- a/addons/pos_self_order/static/tests/tours/self_order_after_meal_cart_tour.js +++ b/addons/pos_self_order/static/tests/tours/self_order_after_meal_cart_tour.js @@ -23,6 +23,9 @@ registry.category("web_tour.tours").add("self_order_after_meal_cart_tour", { ...PosSelf.action.addProduct("Office Chair Black", 1), ...PosSelf.action.addProduct("Office Chair Black", 2, "Description"), ...PosSelf.action.addProduct("Large Cabinet", 2), + // When clicking on basic product (without image, sale description and attributes) it + // displays the product window. + ...PosSelf.action.addProduct("Virtual Home Staging", 1), PosSelf.action.clickPrimaryBtn("Review"), // Here we're looking at whether when an orderline is clicked on from