From dfd9da8aab37225c3a5785e2845d94e471b506a7 Mon Sep 17 00:00:00 2001 From: "stefanorigano (SRI)" Date: Tue, 12 Oct 2021 14:27:38 +0000 Subject: [PATCH] [FIX] website_sale_comparison: "compare" button position/visibility Show the "compare" button if attributes&variants exist only. In the product's page render the button in the "Specifications" section only. task#2667024 Part-of: odoo/odoo#79651 --- .../tests/tours/website_sale_comparison.js | 16 +++++------ .../website_sale_comparison_template.xml | 28 ++++++------------- 2 files changed, 16 insertions(+), 28 deletions(-) diff --git a/addons/website_sale_comparison/static/tests/tours/website_sale_comparison.js b/addons/website_sale_comparison/static/tests/tours/website_sale_comparison.js index 87f8a76167d..33538c8d26e 100644 --- a/addons/website_sale_comparison/static/tests/tours/website_sale_comparison.js +++ b/addons/website_sale_comparison/static/tests/tours/website_sale_comparison.js @@ -11,8 +11,8 @@ odoo.define('website_sale_comparison.tour_comparison', function (require) { }, [ // test from shop page { - content: "add first product 'Three-Seat Sofa' in a comparison list", - trigger: '.oe_product_cart:contains("Three-Seat Sofa") .o_add_compare', + content: "add first product 'Warranty' in a comparison list", + trigger: '.oe_product_cart:contains("Warranty") .o_add_compare', }, { content: "check compare button contains one product", @@ -36,7 +36,7 @@ odoo.define('website_sale_comparison.tour_comparison', function (require) { }, { content: "check products name are correct in the comparelist", - extra_trigger: '.o_product_row:contains("Three-Seat Sofa")', + extra_trigger: '.o_product_row:contains("Warranty")', trigger: '.o_product_row:contains("Conference Chair")', run: function () {}, }, @@ -126,7 +126,7 @@ odoo.define('website_sale_comparison.tour_comparison', function (require) { }, { content: "check 4th product is correctly added", - trigger: '.o_product_comparison_table:contains("Three-Seat Sofa")', + trigger: '.o_product_comparison_table:contains("Warranty")', run: function () {}, }, { @@ -140,20 +140,20 @@ odoo.define('website_sale_comparison.tour_comparison', function (require) { }, { content: "open compare menu", - extra_trigger: 'body:has(.o_product_row:contains("Three-Seat Sofa") .o_remove)', + extra_trigger: 'body:has(.o_product_row:contains("Warranty") .o_remove)', trigger: '.o_product_panel_header', }, { content: "remove product", - trigger: '.o_product_row:contains("Three-Seat Sofa") .o_remove', + trigger: '.o_product_row:contains("Warranty") .o_remove', }, { content: "click on compare button to reload", trigger: '.o_comparelist_button a', }, { - content: "check product 'Three-Seat Sofa' is removed", - trigger: '#o_comparelist_table:not(:contains("Three-Seat Sofa"))', + content: "check product 'Warranty' is removed", + trigger: '#o_comparelist_table:not(:contains("Warranty"))', run: function () {}, }, { diff --git a/addons/website_sale_comparison/views/website_sale_comparison_template.xml b/addons/website_sale_comparison/views/website_sale_comparison_template.xml index 3ecb796d464..3ebee76f732 100644 --- a/addons/website_sale_comparison/views/website_sale_comparison_template.xml +++ b/addons/website_sale_comparison/views/website_sale_comparison_template.xml @@ -3,27 +3,12 @@ - - - -