Skip to content
Permalink
Browse files

🛡 corrected work of tours

  • Loading branch information...
fedoranvar committed Aug 16, 2019
1 parent b996e70 commit b2357b95d65cf65b043c7a0c1d925e66ebec42b7
Showing with 18 additions and 27 deletions.
  1. +18 −27 pos_menu/static/src/js/tour.js
@@ -6,13 +6,13 @@ odoo.define('pos_menu.tour', function(require) {

var _t = core._t;

function pos_opening(){
function pos_opening(pos){
return [{
trigger: '.o_app[data-menu-xmlid="point_of_sale.menu_point_root"], .oe_menu_toggler[data-menu-xmlid="point_of_sale.menu_point_root"]',
content: _t("Ready to launch your <b>point of sale</b>? <i>Click here</i>."),
position: 'bottom',
}, {
trigger: ".o_pos_kanban .o_kanban_record:not(:first) button.oe_kanban_action_button",
trigger: ".o_kanban_record:contains("+ pos +") .btn-primary:first",
content: _t("<p>Click to start the point of sale interface. It <b>runs on tablets</b>, laptops, or industrial hardware.</p><p>Once the session launched, the system continues to run without an internet connection.</p>"),
position: "bottom"
}, {
@@ -31,38 +31,29 @@ odoo.define('pos_menu.tour', function(require) {
trigger: '.table:not(.oe_invisible .neworder-button), .order-button.selected',
position: "bottom"
}, {
trigger: '.product-list .product-name:contains()',
content: "Add products",
position: "top",
run: function(){
for (var i = 0; i < menu.length; i++) {
$('.product-list .product-name:contains(' + menu[i] + ')').click();
}
},
}];
}

function pos_closing(){
return [{
trigger: ".header-button",
content: "close the Point of Sale frontend",
content: "Add product #1",
trigger: '.product-name:contains('+ menu[0] +')',
position: "bottom"
}, {
trigger: ".header-button.confirm",
content: "confirm closing the frontend",
content: "Add product #2",
trigger: '.product-name:contains('+ menu[1] +')',
position: "bottom"
}, {
content: "wait until backend is opened",
trigger: '.o_app[data-menu-xmlid="point_of_sale.menu_point_root"], .oe_menu_toggler[data-menu-xmlid="point_of_sale.menu_point_root"]',
run: function () {
// no need to click on trigger
},
}];
content: "Add product #3",
trigger: '.product-name:contains('+ menu[2] +')',
position: "bottom"
}, {
content: "Add product #4",
trigger: '.product-name:contains('+ menu[3] +')',
position: "bottom"
}];
}

var steps = [];
var menu = ["Boni Oranges", "Black Grapes", "Carrots", "Conference pears"];
steps = steps.concat(pos_opening());
var pos = "Shop1";
steps = steps.concat(pos_opening(pos));
steps = steps.concat(check_menu(menu));
steps = steps.concat(pos_closing());

tour.register('pos_menu_tour', {url: '/web', test: true,}, steps);
});

0 comments on commit b2357b9

Please sign in to comment.
You can’t perform that action at this time.