Skip to content
Permalink
Browse files

Merge pull request #1059 from fedoranvar/12.0-pos_keyboard-port

⬆️1️⃣2️⃣, pos_keyboard:
  • Loading branch information...
itpp-bot committed Aug 23, 2019
2 parents d6f8a9c + 597ac9d commit 18cb1827fb271ced3a08535be34b4b749a49d057
@@ -15,6 +15,7 @@ Contributors
------------
* `Ivan Yelizariev <https://it-projects.info/team/yelizariev>`__
* `Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>`__
* `Anvar Kildebekov <https://it-projects.info/team/fedoranvar>`__

Sponsors
--------
@@ -24,7 +25,7 @@ Maintainers
-----------
* `IT-Projects LLC <https://it-projects.info>`__

To get a guaranteed support you are kindly requested to purchase the module at `odoo apps store <https://apps.odoo.com/apps/modules/11.0/pos_keyboard/>`__.
To get a guaranteed support you are kindly requested to purchase the module at `odoo apps store <https://apps.odoo.com/apps/modules/12.0/pos_keyboard/>`__.

Thank you for understanding!

@@ -33,12 +34,12 @@ Maintainers
Further information
===================

Demo: http://runbot.it-projects.info/demo/pos-addons/11.0
Demo: http://runbot.it-projects.info/demo/pos-addons/12.0

HTML Description: https://apps.odoo.com/apps/modules/11.0/pos_keyboard/
HTML Description: https://apps.odoo.com/apps/modules/12.0/pos_keyboard/

Usage instructions: `<doc/index.rst>`_

Changelog: `<doc/changelog.rst>`_

Tested on Odoo 11.0 77e7d952b4c72d58c1b8f34b57e355f5b98c88b0
Tested on Odoo 12.0 d177e8f53b01f5e09c9b49c945781b69baac7009
@@ -3,14 +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 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": "11.0.1.1.3",
"version": "12.0.1.1.5",
"application": False,

"author": "IT-Projects LLC, Ivan Yelizariev",
@@ -39,7 +40,7 @@
"uninstall_hook": None,

"auto_install": False,
"installable": False,
"installable": True,

# "demo_title": "{MODULE_NAME}",
# "demo_addons": [
@@ -1,3 +1,14 @@

`1.1.5`
-------

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

`1.1.4`
-------

**Fix:** Incompatibility with some modules led to the action duplicating

`1.1.3`
-------

@@ -15,24 +15,24 @@ <h3 class="oe_slogan">How It Works</h3>
<font style="font-size: 120%;">
<p> Users can take advantage of a regular keyboard to process pop-up actions, for example, enter a PIN on cashier changing.</p>
</font>
</p>
</p>
</div>
<div class="oe_screenshot" align="center">
<img style="max-width: 40%" src="keyboard_2.png"/>
</div>

<div class="oe_span12 text-center">
<p class="oe_mt32">
<font style="font-size: 120%;">
<p> In the Sale process cashiers can operate with the hotkeys for each of <i> Qty, Price, Disc, +/- modes </i> by using Numpad/Extra keys and after which they can enter necessary numbers.</p>
</font>
</p>
</p>
</div>
<div class="oe_screenshot" align="center">
<img style="max-width: 60%" src="keyboard_1.png"/>
</div>
</section>
</section>

<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span8">
@@ -62,7 +62,7 @@ <h2>Need our service?</h2>
-o-transform: rotate(8deg);
-moz-transform: rotate(8deg);
-ms-transform: rotate(8deg);">
Tested on Odoo<br/>10.0 community
Tested on Odoo<br/>12.0 community
</div>
<!--<div style="margin-top: 15px;
position: relative;
@@ -2,6 +2,8 @@
Copyright 2016 ufaks <https://github.com/ufaks>
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";
@@ -134,6 +136,7 @@ odoo.define('pos_keyboard.pos', function (require) {
val: undefined
};
this.action_callback = undefined;
this.active = false;
},

save_callback: function(){
@@ -159,6 +162,9 @@ odoo.define('pos_keyboard.pos', function (require) {
// calling the callback when needed.
connect: function(){
var self = this;
if (self.active) {
return;
}
// --- additional keyboard ---//
// KeyCode: + or - (Keypad '+')
var KC_PLU = 107;
@@ -258,11 +264,13 @@ odoo.define('pos_keyboard.pos', function (require) {
}, 50);
}
});
self.active = true;
},

// stops catching keyboard events
disconnect: function(){
$('body').off('keyup', '');
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";
@@ -9,6 +10,10 @@ odoo.define('pos_keyboard.tour', function (require) {

function open_pos_neworder() {
return [{
trigger: 'ul.o_menu_apps li.dropdown a.full',
content: _t("Show Apps Menu"),
position: 'bottom',
}, {
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',
@@ -20,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',
@@ -57,13 +62,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 +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 18cb182

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