TIP: You can type at any time to perform a new search.
Product Class
product_class · OCA/product-attribute
- Repository
- OCA/product-attribute · module folder · Try on Runboat
- Module version
- Category
- Product
- Folder size
- 0.09 MB
- License
- AGPL-3
- Application
- No
- Auto-installable
- No
- Website
- https://github.com/OCA/product-attribute
- Last tracking update
- 2026-08-10 17:31:07
- Authors
- Camptocamp, Odoo Community Association (OCA)
- Maintainers
- Camptocamp, Odoo Community Association (OCA)
- Committers
- Ricardoalso, Iván Todorovich, Weblate, OCA-git-bot, oca-ci
- Odoo dependencies
- Python dependencies
- None
- System dependencies
- None
- Required by
- None
- Description
## 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
Code Analysis ⓘ
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=Truestring='Attribute' -
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.