콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
8468 화면

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
4587
2
7월 21
11358
0
4월 19
4508
2
8월 17
10927
1
3월 15
6218