Odoo Help


Default Customer on POS

Néstor Gómez Muñoz
on 1/21/15, 4:08 PM 3,206 views

In a Point of Sale, by default appears 'Unknown Customer' as client name, so we click on that name, appears a list of customers and select the desired customer to finaly click on the Set Customer button. This is for each sale.

Do you know a way to preset a default customer, say 'Generic Client' avoiding having to select it each time?

I already try on pos.xml, but can only change the name whith out affecting the object.


My solucion: Add a field x_default_client, on pos.config model and modified form view to add that field. There I can define which partner will be. On point_of_sale module, on static/src/js/models.js, I added the line this.set_default_client(order) on function 'add_new_order()' and defined that new function 'set_default_client(order)' where is searched the partner using x_default= order.pos.config.x_default_client and setting default_client = this.db.get_partner_by_id(x_default[0]) Some more code to validate and so.

Néstor Gómez Muñoz
on 2/10/15, 12:58 PM
Arafat Ali
On 2/8/18, 2:46 AM

Hi, is there a way to achieve this in Odoo 11 ?

Jairo Quezada
On 1/5/16, 1:50 AM

Good evening, I'm using Odoo 8 and I would like to facilitate me the code of the solution to establish a customer default at the point of sale .Thank you

--Excerpt from OCB/addons/point_of_sale/static/src/js/models.js, with aproximated line numbers: 460 //creates a new empty order and sets it as the current order 461 add_new_order: function(){ 462 var order = new module.Order({pos:this}); 463 this.get('orders').add(order); 464 this.set('selectedOrder', order); 465 this.set_default_client(order); 466 }, 467 468 // set default client from pos.config 469 set_default_client: function(order) { 470 var default_client; 471 var x_default = order.pos.config.x_default_client; 472 var client_id; 473 if (x_default) { 474 client_id=parseInt(x_default[0]); 475 } 476 default_client = this.db.get_partner_by_id(client_id); 477 if (default_client) { 478 order.set_client(default_client); 479 } 480 },

Néstor Gómez Muñoz
on 1/5/16, 12:57 PM

Thanks for the help. Very thoughtful of you. Now I'm trying to enable the physical taclado with the post, trying to jquery.hotkeys.js, any ideas for a case? Yelizariev POS_Keyboard module only enables the keypad.

Jairo Quezada
on 1/12/16, 9:45 PM

Olá Néstor, I've attempted to follow your instructions to set a default customer for each of my three POS. I managed to create a new field x_default_client and checked that it in fact exists using pgAdmin, I successfully added the field to the form view pos.config and I also added the code to C:\Program Files (x86)\Odoo 8.0-20150511\server\openerp\addons\point_of_sale\static\src\js\models.js However, I have created a client called "Indiferenciado" that has partner_id=30 and I set the x_default_client to 30 on all Points of sale, but they still default to "Unknown Customer" when I open a POS session. What might I be doing wrong?

Daniel Holden
on 1/29/16, 10:50 AM

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: 1/21/15, 4:08 PM
Seen: 3206 times
Last updated: 2/8/18, 2:46 AM