Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
8452 Переглядів

Hello all,

See the screen below. At this place, by default, the « enter » key of the keyboard has the same behavior than a click on the « Validate » button. 

We rather want that the « enter » key simulate a click of the « Invoice » button.

How to achieve this?

Thanks


Аватар
Відмінити
Найкраща відповідь

Hi @Pascal Tremblay

Here is how:

openerp.pos_test = function (instance) {
var _t = instance.web._t,
_lt = instance.web._lt;
var QWeb = instance.web.qweb;

instance.point_of_sale.PaymentScreenWidget.include({
init: function(parent, options) {
var self = this;
this._super(parent,options);
document.body.removeEventListener('keyup',this.hotkey_handler);
this.hotkey_handler = function(event){
if(event.which === 13){
self.validate_order({invoice: true});
}else if(event.which === 27){
self.back();
}
};
document.body.addEventListener('keyup', this.hotkey_handler);
}
});
}
Аватар
Відмінити
Автор

Thanks 1000 times. I could never code it myself! Ouf!

Happy to help

Автор

This code works well. Thanks again.

Найкраща відповідь

where to put this code please


Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
2
вер. 24
4551
2
лип. 21
11339
0
квіт. 19
4499
2
серп. 17
10919
1
бер. 15
6214