コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
8473 ビュー

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


アバター
破棄
関連投稿 返信 ビュー 活動
2
9月 24
4593
2
7月 21
11361
0
4月 19
4511
2
8月 17
10928
1
3月 15
6218