diff --git a/addons/event_sale/__manifest__.py b/addons/event_sale/__manifest__.py index 2293b52dfb5..839ef948898 100644 --- a/addons/event_sale/__manifest__.py +++ b/addons/event_sale/__manifest__.py @@ -21,6 +21,7 @@ this event. 'depends': ['event', 'sale_management'], 'data': [ 'views/event_views.xml', + 'views/event_views_template.xml', 'views/product_views.xml', 'views/sale_order_views.xml', 'data/event_sale_data.xml', diff --git a/addons/event_sale/static/src/js/tour.js b/addons/event_sale/static/src/js/tour.js new file mode 100644 index 00000000000..148e1e14032 --- /dev/null +++ b/addons/event_sale/static/src/js/tour.js @@ -0,0 +1,13 @@ +odoo.define("event_sale.tour", function (require) { + "use strict"; + + var tour = require('web_tour.tour'); + require('sale.tour'); + + var step_index = _.findIndex(tour.tours.sale_tour.steps, function (step) { + return (step.id === "form_button_save_clicked"); + }); + tour.tours.sale_tour.steps.splice(step_index, 0, { + trigger: ".modal-dialog .modal-footer .btn-primary:contains('Save & Close')", + }); +}); diff --git a/addons/event_sale/views/event_views_template.xml b/addons/event_sale/views/event_views_template.xml new file mode 100644 index 00000000000..ae3ffef9752 --- /dev/null +++ b/addons/event_sale/views/event_views_template.xml @@ -0,0 +1,8 @@ + + + + diff --git a/addons/sale/static/src/js/tour.js b/addons/sale/static/src/js/tour.js index fe4eac6fbbc..3af1f0364af 100644 --- a/addons/sale/static/src/js/tour.js +++ b/addons/sale/static/src/js/tour.js @@ -58,12 +58,12 @@ tour.register('sale_tour', { $('.modal-dialog:has(div.o_dialog_warning) footer.modal-footer .btn-primary').trigger('click'); } }, - id: "quotation_product_selected", }, { trigger: ".o_form_button_save", extra_trigger: ".o_sale_order", content: _t("Once your quotation is ready, you can save, print or send it by email."), position: "right", + id: "form_button_save_clicked" }, { trigger: ".o_sale_print", extra_trigger: ".o_sale_order.o_form_readonly", diff --git a/addons/sale_management/static/tests/product_configurator_test_ui.js b/addons/sale_management/static/tests/product_configurator_test_ui.js index 57bb3340394..03f5a0a8bbc 100644 --- a/addons/sale_management/static/tests/product_configurator_test_ui.js +++ b/addons/sale_management/static/tests/product_configurator_test_ui.js @@ -70,6 +70,7 @@ tour.register('sale_product_configurator_tour', { }, { trigger: 'button span:contains(Confirm)', extra_trigger: '.oe_optional_products_modal', + id: "quotation_product_selected", run: 'click' }, // check that 3 products were added to the SO diff --git a/addons/sale_stock/static/src/js/tour.js b/addons/sale_stock/static/src/js/tour.js index 2cc85671aef..d27080305d5 100644 --- a/addons/sale_stock/static/src/js/tour.js +++ b/addons/sale_stock/static/src/js/tour.js @@ -4,17 +4,26 @@ odoo.define("sale_stock.tour", function (require) { var tour = require('web_tour.tour'); require('sale.tour'); - var quotation_product_selected_step_index = _.findIndex(tour.tours.sale_tour.steps, function (step) { + var quotation_product_selected_step_index = _.findIndex(tour.tours.sale_product_configurator_tour.steps, function (step) { return (step.id === "quotation_product_selected"); }); - tour.tours.sale_tour.steps[quotation_product_selected_step_index].run = function (actions) { + tour.tours.sale_product_configurator_tour.steps[quotation_product_selected_step_index].run = function (actions) { actions.auto(); }; - tour.tours.sale_tour.steps.splice(quotation_product_selected_step_index+1, 0, { - trigger: ".modal-footer .btn-primary", + tour.tours.sale_product_configurator_tour.steps.splice(quotation_product_selected_step_index+1, 0, { + trigger: ".o_dialog_warning + .modal-footer .btn-primary", auto: true, + run: function (actions) { + actions.auto('.o_dialog_warning + .modal-footer .btn-primary'); + } + }, { + trigger: ".o_dialog_warning + .modal-footer .btn-primary", + auto: true, + run: function (actions) { + actions.auto('.o_dialog_warning + .modal-footer .btn-primary'); + } }, { trigger: "body:not(:has(.o_dialog_warning))", auto: true,