diff --git a/website_product_configurator/static/src/js/website_config_tour.js b/website_product_configurator/static/src/js/website_config_tour.js index 288dede7b5..326cf39526 100644 --- a/website_product_configurator/static/src/js/website_config_tour.js +++ b/website_product_configurator/static/src/js/website_config_tour.js @@ -26,14 +26,13 @@ odoo.define("website_product_configurator.tour_configuration", function (require }, { content: "click to select fuel", - trigger: "div.tab-pane.container.fade.active.in select:first", - extra_trigger: ".nav-item.config_step.active a:contains(Engine)", + trigger: ".tab-pane.fade.container.show.active select", run: function () { $( - ".tab-pane.container.fade.active.in select:first option:contains(Gasoline)" + ".tab-pane.fade.container.show.active select:first option:contains(Gasoline)" )[0].selected = true; $( - ".tab-pane.container.fade.active.in select:first option:contains(Gasoline)" + ".tab-pane.fade.container.show.active select:first option:contains(Gasoline)" ) .closest("select") .change(); @@ -42,13 +41,13 @@ odoo.define("website_product_configurator.tour_configuration", function (require { content: "click to select engine", trigger: - ".tab-pane.container.fade.active.in select.form-control.config_attribute.required_config_attrib", + ".tab-pane.fade.container.show.active select.form-control.config_attribute.cfg-select.required_config_attrib", run: function () { $( - ".tab-pane.container.fade.active.in select.form-control.config_attribute.required_config_attrib option:contains(218i)" + ".tab-pane.fade.container.show.active select > option:contains(218i)" )[0].selected = true; $( - ".tab-pane.container.fade.active.in select.form-control.config_attribute.required_config_attrib option:contains(218i)" + ".tab-pane.fade.container.show.active select > option:contains(218i)" ) .closest("select") .change(); @@ -56,18 +55,18 @@ odoo.define("website_product_configurator.tour_configuration", function (require }, { content: "click on continue", - trigger: "#form_action span:contains(Continue)", + trigger: "span:contains(Continue)", + run: "click", }, { content: "click to select color", - extra_trigger: ".nav-item.config_step.active a:contains(Body)", - trigger: "div.tab-pane.container.fade.active.in select:first", + trigger: ".tab-pane.fade.container.show.active select", run: function () { $( - ".tab-pane.container.fade.active.in select:first option:contains(Silver)" + ".tab-pane.fade.container.show.active select:first option:contains(Silver)" )[0].selected = true; $( - ".tab-pane.container.fade.active.in select:first option:contains(Silver)" + ".tab-pane.fade.container.show.active select:first option:contains(Silver)" ) .closest("select") .change(); @@ -76,13 +75,13 @@ odoo.define("website_product_configurator.tour_configuration", function (require { content: "click to select rims", trigger: - "div.tab-pane.container.fade.active.in select.form-control.config_attribute.required_config_attrib", + ".tab-pane.fade.container.show.active select.form-control.config_attribute.cfg-select.required_config_attrib", run: function () { $( - ".tab-pane.container.fade.active.in select.form-control.config_attribute.required_config_attrib option:contains(V-spoke 16)" + ".tab-pane.fade.container.show.active select > option:contains(V-spoke 16)" )[0].selected = true; $( - ".tab-pane.container.fade.active.in select.form-control.config_attribute.required_config_attrib option:contains(V-spoke 16)" + ".tab-pane.fade.container.show.active select > option:contains(V-spoke 16)" ) .closest("select") .change(); @@ -90,18 +89,19 @@ odoo.define("website_product_configurator.tour_configuration", function (require }, { content: "click on continue", - trigger: "#form_action span:contains(Continue)", + extra_trigger: ".nav-item.config_step a:contains(Lines)", + trigger: "span:contains(Continue)", + run: "click", }, { content: "click to select Lines", - extra_trigger: ".nav-item.config_step.active a:contains(Lines)", - trigger: ".tab-pane.container.fade.active.in select:first", + trigger: ".tab-pane.fade.container.show.active select", run: function () { $( - ".tab-pane.container.fade.active.in select:first option:contains(Sport Line)" + ".tab-pane.fade.container.show.active select option:contains(Sport Line)" )[0].selected = true; $( - ".tab-pane.container.fade.active.in select:first option:contains(Sport Line)" + ".tab-pane.fade.container.show.active select option:contains(Sport Line)" ) .closest("select") .change(); @@ -109,18 +109,18 @@ odoo.define("website_product_configurator.tour_configuration", function (require }, { content: "click on continue", - trigger: "#form_action span:contains(Continue)", + trigger: "span:contains(Continue)", + run: "click", }, { content: "click to select tapistry", - extra_trigger: ".nav-item.config_step.active a:contains(Interior)", - trigger: "div.tab-pane.container.fade.active.in select:first", + trigger: ".tab-pane.fade.container.show.active select", run: function () { $( - ".tab-pane.container.fade.active.in select:first option:contains(Black)" + ".tab-pane.fade.container.show.active select option:contains(Black)" )[0].selected = true; $( - ".tab-pane.container.fade.active.in select:first option:contains(Black)" + ".tab-pane.fade.container.show.active select option:contains(Black)" ) .closest("select") .change(); @@ -128,18 +128,18 @@ odoo.define("website_product_configurator.tour_configuration", function (require }, { content: "click on continue", - trigger: "#form_action span:contains(Continue)", + trigger: "span:contains(Continue)", + run: "click", }, { content: "click to select Transmission", - extra_trigger: ".nav-item.config_step.active a:contains(Extras)", - trigger: "div.tab-pane.container.fade.active.in select:first", + trigger: ".tab-pane.fade.container.show.active select", run: function () { $( - '.tab-pane.container.fade.active.in select:first option:contains("Automatic (Steptronic)")' + '.tab-pane.fade.container.show.active select:first option:contains("Automatic (Steptronic)")' )[0].selected = true; $( - '.tab-pane.container.fade.active.in select:first option:contains("Automatic (Steptronic)")' + '.tab-pane.fade.container.show.active select:first option:contains("Automatic (Steptronic)")' ) .closest("select") .change(); @@ -148,13 +148,13 @@ odoo.define("website_product_configurator.tour_configuration", function (require { content: "click to select Options", trigger: - "div.tab-pane.container.fade.active.in select.form-control.config_attribute.required_config_attrib", + ".tab-pane.fade.container.show.active select.form-control.config_attribute.cfg-select.required_config_attrib", run: function () { $( - ".tab-pane.container.fade.active.in select.form-control.config_attribute.required_config_attrib option:contains(Armrest)" + ".tab-pane.fade.container.show.active select > option:contains(Armrest)" )[0].selected = true; $( - ".tab-pane.container.fade.active.in select.form-control.config_attribute.required_config_attrib option:contains(Armrest)" + ".tab-pane.fade.container.show.active select > option:contains(Armrest)" ) .closest("select") .change(); @@ -162,7 +162,18 @@ odoo.define("website_product_configurator.tour_configuration", function (require }, { content: "click on continue", - trigger: "#form_action span:contains(Continue)", + trigger: "span:contains(Continue)", + run: "click", + }, + { + content: "click on add to cart", + trigger: "#add_to_cart", + run: "click", + }, + { + content: "proceed to checkout product", + trigger: 'a[href*="/shop/checkout"]', + run: "click", }, ] ); diff --git a/website_product_configurator/tests/test_sale_order.py b/website_product_configurator/tests/test_sale_order.py index 5190c9e620..694b6f91a2 100644 --- a/website_product_configurator/tests/test_sale_order.py +++ b/website_product_configurator/tests/test_sale_order.py @@ -62,6 +62,14 @@ def test_cart_update(self): cart_update.get("quantity"), self.sale_order.order_line.product_uom_qty ) + self.sale_order.write({"order_line": False}) + self.sale_order._cart_update( + product_id=product_id, + set_qty=1, + add_qty=1, + ) + self.assertTrue(self.sale_order.order_line, "No Sale Order Line created.") + def test_get_real_price_currency(self): price, rule_id = self.sale_order.pricelist_id.get_product_price_rule( self.sale_order.order_line.product_id,