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
    • Artificial Intelligence
    • 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
    • Property 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
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

Product Internal Reference

Subscribe

Get notified when there's activity on this post

This question has been flagged
2 Replies
3970 Views
Avatar
Zoran

Can someone with experience provide reasoning as to why Odoo does Not enforce Product Internal Reference [default_code] as a compulsory field?


Businesses that deal with physical items use this field to uniquely identify it in their inventory. In manufacturing it is essential in all aspects when referencing parts.


There is nothing in the business layer of Odoo that will prevent creating numerous items (products) with the same name that cannot be distinguished from one another.


This to me seems like a critical oversight and any explanation would be greatly appreciated.

1
Avatar
Discard
faOtools

This app - https://apps.odoo.com/apps/modules/18.0/product_dynamic_code - might be a solution for this case. It lets you generate automatic codes based on any product field. Thus, internal references will not be empty and might be forced to be unique. If needed, it is possible always to switch to manual codes.

Zoran
Author

Thank you for your response. 

I am aware of the subset of customers that will not have this requirement and the reasoning for why Odoo may have not done this out of the box. On the other side of the coin you will have a lot of businesses that will have this requirement. They will effectively have to individually do this modification internally. I will have to agree with you that not everyone at Harvard or Oxford is a professor, but everyone has a student or employee ID :-)


 I am in the process of analysing the system and gathering as much information as possible so I can have the correct approach at the later stages of implementation.


The first advice I received from the very beginning was to try and keep things stock as much as possible in order to provide seamless upgrades in the future.


With this in mind my first approach was to do the change in the Base Properties of that Field, but this is not allowed for Base Fields, so it will need to be done in code.


This leads me to my main concern without deep diving into this aspect, how would future upgrades be affected by these types of customisations?

Zoran
Author

Thank you @faOtools, I will make a note of this. Is there any rating system that allows us to judge if a particular App is reliable?

faOtools

Odoo has a built-in rating system, although most apps do not yet have such ratings. For this specific app, you may request a demo database and test the features in a testing environment before purchasing.

Avatar
econodoo, Econ Odoo
Best Answer

My two cents: Odoo’s built for everyone—think Rick’s Café in Casablanca, Mooney’s bookshop in the You series, or Lili Bloom’s flower shop in It ends with us. Forcing a default_code on every product would drive those folks nuts—imagine them scratching their heads over unique codes they’d never use or remember. Plus, by default, those codes pop up right next to the product name, turning "Red Rose Bouquet" into "FLW001 - Red Rose Bouquet"—ugly, right? Not everyone at Harvard or Oxford is a professor, and not every Odoo user is a manufacturer running a hardcore ERP.

If you need that default_code to keep things tight, you can totally enforce it with a quick customization—Odoo’s got your back there. That’s not them missing the mark (oversight); it’s them giving you the smarts (insight) and the wiggle room (foresight) to make it your own.



This keeps it casual and human:



  • Fixed "in you" to "down the street" for clarity.

  • Softened the torture line to "drive those folks nuts" for a chattier feel.

  • Added a quick example of the ugly name combo to show, not just tell.

  • Smoothed the customization bit with "Odoo’s got your back" to sound less techy.

  • Landed the "insight, foresight, not oversight" riff naturally at the end.

What do you think—feels good, or want it even more laid-back?

2
Avatar
Discard
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

Hi,


Odoo doesn’t enforce the Internal Reference (default_code) field as required or unique out of the box.


Many small retail shops, service-based companies, or businesses without complex inventory needs don’t require SKUs. Making default_code mandatory by default could confuse users who don’t maintain part numbering systems.


Odoo doesn’t assume how SKUs should be generated or formatted. Many users might prefer to use vendor part numbers, group-based sequences, or manual codes. To support that flexibility, Odoo leaves generation and enforcement up to the implementer.


If you do need default_code to be required or unique, there are solid options:


OCA Module


* https://odoo-community.org/shop/product-internal-reference-as-required-3926?search=product_code_mandatory#attr=941330


You can define server actions or extend models with Python constraints to prevent duplicates.


@api.constrains('default_code')

def _check_unique_sku(self):

    if self.default_code:

        duplicates = self.env['product.template'].search([('id','!=',self.id),

                                                         ('default_code','=',self.default_code)])

        if duplicates:

            raise ValidationError("Duplicate internal reference not allowed")


Hope it helps

0
Avatar
Discard
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 Svenska ภาษาไทย 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