From edfa62bbaed888558da7ce88503b5bd168c30e54 Mon Sep 17 00:00:00 2001 From: Romain Derie Date: Wed, 13 Feb 2019 13:02:52 +0000 Subject: [PATCH] [FIX] website_sale: remove race condition on variant tour MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit, there was a possible race condition in the `tour_shop_dynamic_variants` tour. Indeed, the `click add to cart` would be triggered before the `click on the second variant` RPCs are done. Trigger on `.oe_price .oe_currency_value:contains("0.00")` was supposed to check that condition but it was not strong enough. Then, clicking on add to cart would not call `create_product_variant` as it would still have the first variant id in the hidden input instead of "0". closes odoo/odoo#31670 Signed-off-by: Jérémy Kersten (jke) --- .../static/src/js/website_sale_tour_shop_dynamic_variants.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/website_sale/static/src/js/website_sale_tour_shop_dynamic_variants.js b/addons/website_sale/static/src/js/website_sale_tour_shop_dynamic_variants.js index 2007a5e82a1..fbe7f61cba9 100644 --- a/addons/website_sale/static/src/js/website_sale_tour_shop_dynamic_variants.js +++ b/addons/website_sale/static/src/js/website_sale_tour_shop_dynamic_variants.js @@ -26,6 +26,7 @@ tour.register('tour_shop_dynamic_variants', { }, { content: "click add to cart", + extra_trigger: 'body:has(input[type="hidden"][name="product_id"][value=0])', trigger: '#add_to_cart', }, {