Skip to content
Permalink
Browse files

Merge pull request #1084 from fedoranvar/10.0-pos_keyboard-ambulance

  • Loading branch information...
em230418 committed Aug 22, 2019
2 parents 8404730 + a92e261 commit 78dcfa2591504685fa7e34f3bd77f60266c9d059
@@ -11,7 +11,7 @@
"category": "Point Of Sale",
# "live_test_url": "http://apps.it-projects.info/shop/product/DEMO-URL?version={ODOO_BRANCH}",
"images": ['images/keyboard.png'],
"version": "10.0.1.1.4",
"version": "10.0.1.1.5",
"application": False,

"author": "IT-Projects LLC, Ivan Yelizariev",
@@ -1,3 +1,9 @@

`1.1.5`
-------

**Fix:** Function 'disconnect' not working in expected way

`1.1.4`
-------

@@ -3,6 +3,7 @@
Copyright 2016 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
Copyright 2019 Kolushov Alexandr <https://it-projects.info/team/kolushovalexandr>
Copyright 2019 ssaid <https://github.com/ssaid>
Copyright 2019 raulovallet <https://github.com/raulovallet>
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). */
odoo.define('pos_keyboard.pos', function (require) {
"use strict";
@@ -270,7 +271,7 @@ odoo.define('pos_keyboard.pos', function (require) {
// stops catching keyboard events
disconnect: function(){
$('body').off('keyup', '');
self.active = false;
this.active = false;
}
});

@@ -1,4 +1,5 @@
/* Copyright 2019 Kolushov Alexandr <https://it-projects.info/team/kolushovalexandr>
Copyright 2019 Anvar Kildebekov <https://it-projects.info/team/fedoranvar>
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). */
odoo.define('pos_keyboard.tour', function (require) {
"use strict";
@@ -20,7 +21,7 @@ odoo.define('pos_keyboard.tour', function (require) {
content: "Switch to table or make dummy action",
trigger: '.table:not(.oe_invisible .neworder-button), .order-button.selected',
position: "bottom",
timeout: 20000,
timeout: 30000,
}, {
content: 'waiting for loading to finish',
trigger: '.order-button.neworder-button',
@@ -57,13 +58,33 @@ odoo.define('pos_keyboard.tour', function (require) {
}];
}

function connect_disconnect_keyboard() {
var stps = [{
content: "Open Payment-Screen",
trigger: '.pay-circle',
}];

if (odoo._modules.indexOf('pos_cashier_select') !== -1) {
stps = stps.concat([{
trigger: '.modal-dialog.cashier .selection-item:contains("Admin")',
content: 'select first cashier',
}]);
}

stps = stps.concat([{
content: 'Close Payment-Screen',
trigger: '.button:contains(Back)',
}]);
return stps;
}

function open_cashier_popup_and_close_it() {
return [{
content: "Open cashier selection popup",
trigger: '.username',
}, {
content: "Make dummy action and simulate escape button clicking",
trigger: '.modal-dialog:not(".oe_hidden") p.title',
trigger: '.modal-dialog:not(".oe_hidden")',
run: function(){
simulate_keyup_event(27);
setTimeout(function () {
@@ -81,9 +102,12 @@ odoo.define('pos_keyboard.tour', function (require) {
}

var steps = [];
var quantity = 3;
steps = steps.concat(open_pos_neworder());
steps = steps.concat(add_product_to_order('Miscellaneous'));
steps = steps.concat(update_qty_for_product(3));
steps = steps.concat(update_qty_for_product(quantity));
steps = steps.concat(connect_disconnect_keyboard());
steps = steps.concat(update_qty_for_product(quantity+1));
steps = steps.concat(open_cashier_popup_and_close_it());

tour.register('pos_keyboard_tour', { test: true, url: '/web' }, steps);
@@ -13,6 +13,6 @@ def test_pos_keyboard(self):
# without a delay there might be problems on the steps whilst opening a POS
# caused by a not yet loaded button's action
self.phantom_js("/web",
"odoo.__DEBUG__.services['web_tour.tour'].run('pos_keyboard_tour', 100)",
"odoo.__DEBUG__.services['web_tour.tour'].run('pos_keyboard_tour', 500)",
"odoo.__DEBUG__.services['web_tour.tour'].tours.pos_keyboard_tour.ready",
login="admin")

0 comments on commit 78dcfa2

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