[fix] point_of_sale: payment screen backspace

before the fix if hitting the backspace in point of paiment screen would
triger the keypress event twice.

removed the double eventhandler

resolves https://github.com/odoo/odoo/issues/29911

closes odoo/odoo#30031
This commit is contained in:
Gert Pellin
2019-01-08 13:17:16 +00:00
parent 13e47f508f
commit 9246375b25
@@ -1959,16 +1959,11 @@ var PaymentScreenWidget = ScreenWidget.extend({
$('body').keypress(this.keyboard_handler);
// that one comes from the pos, but we prefer to cover all the basis
$('body').keydown(this.keyboard_keydown_handler);
// legacy vanilla JS listeners
window.document.body.addEventListener('keypress',this.keyboard_handler);
window.document.body.addEventListener('keydown',this.keyboard_keydown_handler);
this._super();
},
hide: function(){
$('body').off('keypress', this.keyboard_handler);
$('body').off('keydown', this.keyboard_keydown_handler);
window.document.body.removeEventListener('keypress',this.keyboard_handler);
window.document.body.removeEventListener('keydown',this.keyboard_keydown_handler);
this._super();
},
// sets up listeners to watch for order changes