Product Class
product_class · OCA/product-attribute
Health
60/100
fair
-
Security25/25No findings
-
Activity25/25Last human commit 4 months ago
-
Required by5/250 modules depend on it
-
Maturity5/25In 1 Odoo series since 19.0
Heuristic over the facts below, not an audit · How it's computed
Required by
0
Modules depending on it
External deps
0 pip · 0 bin
Python packages / system binaries
License
AGPL-3
No conflicts with its dependencies
Folder size
0.09 MB
Module directory on disk
Code analysis
0 migration notes
4 models
5 views
0 HTTP endpoints
Description
Product Class
This module introduces Product Classes for standardizing product setup and attribute management. It allows you to:
- Define Product Classes — Group related products into classes (e.g., "Furniture", "Electronics")
- Constrain Attributes per Class — Specify which attributes are allowed for each class
- Mark Required Attributes — Designate certain attributes as mandatory for products in that class
- 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 arequiredflag - 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 modelproduct.class.attribute.line— Bridge model linking classes to attributes with arequiredflagproduct.attribute(inherited) — Extended with reverse one-to-many to track which classes use itproduct.template(inherited) — Added class validation and computed required-attribute tracking
Dependencies
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 5
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
product_attribute_view_form |
product.attribute | form | Inherits product.product_attribute_view_form | |
product_class_form |
product.class | form | New | |
product_class_list |
product.class | list | New | |
product_class_search |
product.class | search | New | |
product_template_form_view |
product.template | form | Inherits product.product_template_only_form_view |
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 4
New fields (2)
-
class_attribute_line_idsOne2many → product.class.attribute.linecomodel_name='product.class.attribute.line'help='Product classes that include this attribute.'inverse_name='attribute_id'string='Class Attribute Lines' -
classes_countIntegercompute='_compute_classes_count'string='Product Classes Count'
-
action_open_product_classes(self)
New fields (3)
-
activeBooleandefault=True -
attribute_line_idsOne2many → product.class.attribute.linecomodel_name='product.class.attribute.line'help='Allowed attributes for products of thisclass and whether they are required.'inverse_name='class_id'string='Attributes' -
nameChartranslate=True
No public methods.
New fields (3)
-
attribute_idMany2one → product.attributecomodel_name='product.attribute'index=Trueondelete='restrict'required=True -
class_idMany2one → product.classcomodel_name='product.class'index=Trueondelete='cascade'required=Truestring='Product Class' -
requiredBooleandefault=Falsehelp='If enabled, products of this class must define this attribute.'
No public methods.
New fields (3)
-
class_attribute_idsMany2many → product.attributecomodel_name='product.attribute'compute='_compute_class_attribute_ids'help='Attributes allowed by the selected product class'string='Class Attributes' -
class_idMany2one → product.classcomodel_name='product.class'help='Product class that constrains which attributes can be used'string='Product Class' -
class_required_attribute_idsMany2many → product.attributecomodel_name='product.attribute'compute='_compute_class_attribute_ids'help='Required attributes for the selected product class.'string='Class Required Attributes'
No public methods.