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
    • 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
      • Get a Tailored Demo
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +32 2 290 34 90
    • Get a Tailored Demo
  • Pricing
  • Help
  1. APPS
  2. Product
  3. Product Class v 19.0
  4. Sales Conditions FAQ

Product Class

by Camptocamp https://github.com/OCA/product-attribute , Odoo Community Association (OCA) https://github.com/OCA/product-attribute
Odoo
v 19.0 Third Party 2
Download for v 19.0 Deploy on Odoo.sh
Apps purchases are linked to your Odoo account, please sign in or sign up first.
You bought this module and need support? Click here!
Odoo Community Association

Product Class

Beta License: AGPL-3 OCA/product-attribute Translate me on Weblate Try me on Runboat

Product Class

This module introduces Product Classes for standardizing product setup and attribute management. It allows you to:

  1. Define Product Classes — Group related products into classes (e.g., “Furniture”, “Electronics”)
  2. Constrain Attributes per Class — Specify which attributes are allowed for each class
  3. Mark Required Attributes — Designate certain attributes as mandatory for products in that class
  4. Enforce Validation — Prevent products from using attributes outside their class or missing required attributes

Key Features

  • Bridge Model (``product.class.attribute.line``) — Manages the relationship between classes and attributes, storing both allowed attributes and a required flag
  • Strict Validation — Products assigned to a class must:
    • Use only attributes defined in that class
    • Provide values for all required attributes
  • UI Enforcement — Attribute selection in product forms is restricted by the class domain filter
  • Management Views — Full CRUD interface for product classes (Inventory > Configuration > Product Classes, Sales > Configuration > Product Classes)

Technical Architecture

  • product.class — Main product classification model
  • product.class.attribute.line — Bridge model linking classes to attributes with a required flag
  • product.attribute (inherited) — Extended with reverse one-to-many to track which classes use it
  • product.template (inherited) — Added class validation and computed required-attribute tracking

Table of contents

  • Usage

Usage

Usage

1. Create a Product Class

Navigation: Inventory → Configuration → Product Classes (or Sales → Configuration → Product Classes)

  1. Click Create button
  2. Enter a Product Class Name (e.g., “Chairs”)
  3. In the Attributes section:
    • Click Add a line
    • Select an Attribute from the dropdown
    • Check Required if products of this class must define this attribute
    • Repeat to add more attributes
  4. Click Save

Example: “Furniture” Class

Attribute Required Notes
Color ✓ All furniture must have a color
Size ✓ Sizes vary by product
Material   Optional (not all items specify)
Finish   Optional polish/coating

2. Assign a Product to a Class

Navigation: Inventory → Products → Products

  1. Create or edit a product
  2. Find the Product Class field in the Attributes & Variants tab (added by this module)
  3. Select the class (e.g., “Furniture”)
  4. The form will now restrict Attributes to only those allowed by the class

3. Add Attribute Lines to a Classed Product

Once a class is selected, you can add attribute lines:

  1. Go to the Attributes & Variants tab
  2. In Attribute Lines, click Add a line
  3. The Attribute field dropdown is now filtered to show only class-allowed attributes
  4. Select an attribute and provide values
  5. Validation will fail if:
    • You select an attribute not in the class → Error: “has attribute lines that do not belong”
    • You leave out a required attribute → Error: “is missing required attributes”

4. Remove an Attribute from a Class

Scenario: Your “Furniture” class allowed “Color” but wants to retire it.

  1. Navigate to the class
  2. In Attributes, find the “Color” line and delete it
  3. Odoo will raise an error if products in this class still use Color
    • Fix: Remove Color from all products in the class first, then retry the class update

Workflow Example

Step 1: Set Up “Chairs” Class

  • Color (required)
  • Size (required)
  • Leg Material (optional)

Step 2: Create a “Wooden Chair” Product

  • Assign class: “Chairs”
  • Add attribute “Color” = Red (satisfies required)
  • Add attribute “Size” = Large (satisfies required)
  • Add attribute “Leg Material” = Oak (optional, still valid)
  • Save ✓ Success

Step 3: Try Invalid Assignment

  • Assign class: “Chairs”
  • Add attribute “Color” = Blue (satisfies required)
  • Try to save without Size → Error: “is missing required attributes for the selected class ‘Chairs’: Size”
  • Add Size = Medium
  • Save ✓ Success

Class Attribute Line Model

The bridge model product.class.attribute.line stores:

Field Type Purpose
class_id Many2one Product class (required, cascade delete)
attribute_id Many2one Product attribute (required)
required Boolean If true, products must define it

Constraint: A class cannot configure the same attribute twice (unique on class_id + attribute_id).

Constraints & Validations

  1. Class Constraint (_check_attribute_ids_used_by_products)
    • Prevents removing an attribute from a class if products still use it
    • Error: “Cannot remove attributes used in products assigned to class…”
  2. Product Constraint (_check_class_attributes)
    • Ensures all attribute lines belong to the class
    • Ensures all required attributes are defined
    • Error: “Product ‘…’ has attribute lines that do not belong to the selected class ‘…’”
    • Error: “Product ‘…’ is missing required attributes for the selected class ‘…’”

Advanced: Access Control

  • User (base.group_user): Can create/read/write product classes and their attributes
  • System/Admin (base.group_system): Full CRUD including delete

Product class attribute lines follow the same access rules.

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits

Authors

  • Camptocamp

Maintainers

This module is maintained by the OCA.

Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

Current maintainers:

Ricardoalso ivantodorovich

This module is part of the OCA/product-attribute project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.
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

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