Odoo Help

Welcome!

This community 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.

1

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

By
Pascal Tremblay
on 11/25/15, 4:04 PM 738 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?

Thanks


1

Axel Mendoza

--Axel Mendoza--
10205
| 7 7 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full time employee trying to understand what to do an how

Reach me at aekroft@gmail.com

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;

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!

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

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