Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
8459 มุมมอง

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 ตอบกลับ มุมมอง กิจกรรม
POS | No Close Session Button แก้ไขแล้ว
2
ก.ย. 24
4556
2
ก.ค. 21
11342
0
เม.ย. 19
4501
2
ส.ค. 17
10920
1
มี.ค. 15
6214