Browse Source

🚑 Duplicated event listener

pull/155/head
Santiago J. Said 5 years ago
committed by Vincent Van Rossem
parent
commit
e96361dce7
  1. 2
      pos_keyboard/__manifest__.py
  2. 11
      pos_keyboard/doc/changelog.rst
  3. 12
      pos_keyboard/static/description/index.html
  4. 10
      pos_keyboard/static/src/js/pos.js

2
pos_keyboard/__manifest__.py

@ -11,7 +11,7 @@
"category": "Point Of Sale", "category": "Point Of Sale",
# "live_test_url": "http://apps.it-projects.info/shop/product/DEMO-URL?version={ODOO_BRANCH}", # "live_test_url": "http://apps.it-projects.info/shop/product/DEMO-URL?version={ODOO_BRANCH}",
"images": ['images/keyboard.png'], "images": ['images/keyboard.png'],
"version": "10.0.1.1.5",
"version": "12.0.1.1.3",
"application": False, "application": False,
"author": "IT-Projects LLC, Ivan Yelizariev", "author": "IT-Projects LLC, Ivan Yelizariev",

11
pos_keyboard/doc/changelog.rst

@ -1,14 +1,3 @@
`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` `1.1.3`
------- -------

12
pos_keyboard/static/description/index.html

@ -15,24 +15,24 @@
<font style="font-size: 120%;"> <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> <p> Users can take advantage of a regular keyboard to process pop-up actions, for example, enter a PIN on cashier changing.</p>
</font> </font>
</p>
</p>
</div> </div>
<div class="oe_screenshot" align="center"> <div class="oe_screenshot" align="center">
<img style="max-width: 40%" src="keyboard_2.png"/> <img style="max-width: 40%" src="keyboard_2.png"/>
</div> </div>
<div class="oe_span12 text-center"> <div class="oe_span12 text-center">
<p class="oe_mt32"> <p class="oe_mt32">
<font style="font-size: 120%;"> <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> <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> </font>
</p>
</p>
</div> </div>
<div class="oe_screenshot" align="center"> <div class="oe_screenshot" align="center">
<img style="max-width: 60%" src="keyboard_1.png"/> <img style="max-width: 60%" src="keyboard_1.png"/>
</div> </div>
</section>
</section>
<section class="oe_container"> <section class="oe_container">
<div class="oe_row oe_spaced"> <div class="oe_row oe_spaced">
<div class="oe_span8"> <div class="oe_span8">
@ -62,7 +62,7 @@
-o-transform: rotate(8deg); -o-transform: rotate(8deg);
-moz-transform: rotate(8deg); -moz-transform: rotate(8deg);
-ms-transform: rotate(8deg);"> -ms-transform: rotate(8deg);">
Tested on Odoo<br/>10.0 community
Tested on Odoo<br/>12.0 community
</div> </div>
<!--<div style="margin-top: 15px; <!--<div style="margin-top: 15px;
position: relative; position: relative;

10
pos_keyboard/static/src/js/pos.js

@ -2,8 +2,6 @@
Copyright 2016 ufaks <https://github.com/ufaks> Copyright 2016 ufaks <https://github.com/ufaks>
Copyright 2016 Ivan Yelizariev <https://it-projects.info/team/yelizariev> Copyright 2016 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
Copyright 2019 Kolushov Alexandr <https://it-projects.info/team/kolushovalexandr> 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). */ License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). */
odoo.define('pos_keyboard.pos', function (require) { odoo.define('pos_keyboard.pos', function (require) {
"use strict"; "use strict";
@ -78,7 +76,7 @@ odoo.define('pos_keyboard.pos', function (require) {
this.inputbuffer = newbuf; this.inputbuffer = newbuf;
$value.text(this.inputbuffer); $value.text(this.inputbuffer);
} }
if (this.popup_type === 'password') {
if (this.popup_type === 'password' && newbuf) {
$value.text($value.text().replace(/./g, '•')); $value.text($value.text().replace(/./g, '•'));
} }
}, },
@ -136,7 +134,6 @@ odoo.define('pos_keyboard.pos', function (require) {
val: undefined val: undefined
}; };
this.action_callback = undefined; this.action_callback = undefined;
this.active = false;
}, },
save_callback: function(){ save_callback: function(){
@ -162,9 +159,6 @@ odoo.define('pos_keyboard.pos', function (require) {
// calling the callback when needed. // calling the callback when needed.
connect: function(){ connect: function(){
var self = this; var self = this;
if (self.active) {
return;
}
// --- additional keyboard ---// // --- additional keyboard ---//
// KeyCode: + or - (Keypad '+') // KeyCode: + or - (Keypad '+')
var KC_PLU = 107; var KC_PLU = 107;
@ -264,13 +258,11 @@ odoo.define('pos_keyboard.pos', function (require) {
}, 50); }, 50);
} }
}); });
self.active = true;
}, },
// stops catching keyboard events // stops catching keyboard events
disconnect: function(){ disconnect: function(){
$('body').off('keyup', ''); $('body').off('keyup', '');
this.active = false;
} }
}); });

Loading…
Cancel
Save