Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Default Customer on POS

Subscribe

Get notified when there's activity on this post

This question has been flagged
8 Replies
14987 Views
Avatar
Néstor Gómez Muñoz

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.

Regards.

2
Avatar
Discard
Néstor Gómez Muñoz
Author

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.

Avatar
Emipro Technologies Pvt. Ltd.
Best Answer

One of the trick you can use from the backend to set the generic customer in every pos.order where customer is not set.

First, You need to create one "Generic Customer" through xml.

ie.

<record id="generic_res_partner" model="res.partner">

<field name="name">Generic Customer</field>

<field name="is_company">1</field>

<field name="email">generic@example.com</field>

</record>

Then inherit the pos.order model and change this method like below.

class PosOrder(models.Model):

     _inherit = 'pos.order'

    @api.model

    def _order_fields(self, ui_order):

        order_fields = super(PosOrder, self)._order_fields(ui_order)

        generic_customer = self.env.ref('module_name.generic_res_partner').id

        order_fields['partner_id'] = ui_order.get('partner_id', False) or generic_customer

        return order_fields

 


1
Avatar
Discard
Avatar
Dhivya N
Best Answer

Hi, please check this OCA module  https://www.odoo.com/apps/modules/12.0/skit_walkin_customer/  
Hope this help you. 

0
Avatar
Discard
Avatar
Arafat Ali
Best Answer

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

0
Avatar
Discard
Avatar
Jairo Quezada
Best Answer

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

0
Avatar
Discard
Néstor Gómez Muñoz
Author

--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 },

Jairo Quezada

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.

Daniel Holden

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?

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now