Odoo Help


How to modify the behavior of the « enter » key in the PoS interface?

Pascal Tremblay
on 11/25/15, 4:04 PM 1,164 views

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?


Axel Mendoza
On 11/25/15, 8:13 PM

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;

init: function(parent, options) {
var self = this;
this.hotkey_handler = function(event){
if(event.which === 13){
self.validate_order({invoice: true});
}else if(event.which === 27){
document.body.addEventListener('keyup', this.hotkey_handler);

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

Pascal Tremblay
on 11/25/15, 8:37 PM

Happy to help

Axel Mendoza
on 11/25/15, 8:42 PM

This code works well. Thanks again.

Pascal Tremblay
on 12/7/15, 3:54 PM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 11/25/15, 4:04 PM
Seen: 1164 times
Last updated: 11/26/15, 1:36 AM