Skip to content
Permalink
Browse files

🛡 JS-tour for connect-disconnect keyboard

  • Loading branch information...
fedoranvar committed Aug 19, 2019
1 parent 134ca27 commit 597ac9d657fc8c242784955bc2ef2bc5c5c070c1
Showing with 29 additions and 6 deletions.
  1. +1 −1 pos_keyboard/README.rst
  2. +2 −2 pos_keyboard/__manifest__.py
  3. +26 −3 pos_keyboard/static/src/js/test_pos_keyboard.js
@@ -15,7 +15,7 @@ Contributors
------------
* `Ivan Yelizariev <https://it-projects.info/team/yelizariev>`__
* `Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>`__
* `Kildebekov Anvar <https://it-projects.info/team/KildebekovAnvar>`__
* `Anvar Kildebekov <https://it-projects.info/team/fedoranvar>`__

Sponsors
--------
@@ -3,15 +3,15 @@
# Copyright 2016-2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# Copyright 2018 Ruslan Ronzhin <https://it-projects.info/team/rusllan>
# Copyright 2019 Kolushov Alexandr <https://it-projects.info/team/kolushovalexandr>
# Copyright 2019 Kildebekov Anvar https://it-projects.info/team/kildebekov>
# Copyright 2019 Anvar Kildebekov https://it-projects.info/team/fedoranvar>
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
{
"name": """Keyboard support in Point Of Sale""",
"summary": """Module allows to use usual keyboard (not virtual one) in Point of Sale""",
"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.5",
"version": "12.0.1.1.5",
"application": False,

"author": "IT-Projects LLC, Ivan Yelizariev",
@@ -1,5 +1,5 @@
/* Copyright 2019 Kolushov Alexandr <https://it-projects.info/team/kolushovalexandr>
Copyright 2019 Kildebekov Anvar <https://it-projects.info/team/kildebekov>
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";
@@ -25,7 +25,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',
@@ -62,6 +62,26 @@ 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",
@@ -86,9 +106,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);

0 comments on commit 597ac9d

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