Product - Propagate Active Value
This module extends the functionnaly of Odoo Product module.
By default, in Odoo,
- when a user disable a template, it will disable the related variants.
- when a user enable a template, it will enable the related variants.
But if a user disables all the variants of a template, the related template will still remain active, what doesn't make sense in many case, and which will force the user to disable the template as well, to avoid seeing the obsolete template.
This module avoids having inconsistent states between the active field of the varinats and the active field of the template.
Once installed:
- if a user disables a variant, it will disable the template, if all the variants are disabled.
- if a user enables a variant, it will enable the template.
auto_awesome What this module does
AI-generated from the code · Odoo 12.0Keeps product templates and their variants in sync when you activate or deactivate products. If you disable the last active variant, the template is disabled too; if you enable any variant, the template is enabled again.
This module changes how the active/inactive flag behaves between a product template and its variants.
- When you deactivate a variant (
product.product) and that was the last active variant of its template, the template (product.template) is automatically deactivated as well. - When you activate a variant, its template is automatically activated.
- The check runs every time the active flag is changed on a variant, so you do not have to manually deactivate or reactivate the template afterwards.
It works on the product variant model and touches the related product template. No new menus, screens, buttons or reports are added; the change happens silently in the background when you save a product with a changed active status.
A safety flag prevents the automatic update from looping back on itself, so the template update does not trigger another variant update. The module only reacts to changes of the active field; other product fields are not affected.
Depends on
Models and fields (1)
- product.product · extends an existing model
Text generated by AI (DeepSeek) from reading the Odoo 12.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub
Availability by version
Reviewed: 2026-11-03Confirmation status: 1 confirmed, 8 with no information of 9 versions.
Sources · Odoo 12.0
Confirmed on 2026-11-03 in branch 12.0 of OCA/product-attribute.
terminal Installation and usage
OCA documentation · Odoo 12.0Installation
Source · Odoo 12.0If you are installing this module on a database with existing data, you could want to execute the two following SQL requests, to fix some inconsistent data.
- Disable templates that do not have a single variant active
UPDATE product_template pt
SET active = false
WHERE id in (
SELECT pt.id
FROM product_template pt
INNER JOIN product_product pp on pp.product_tmpl_id = pt.id
WHERE pt.active = true
GROUP BY pt.id
HAVING sum((pp.active)::int) = 0
);- Enable templates that have at least one active variant
UPDATE product_template pt
SET active = true
WHERE id in (
SELECT pt.id
FROM product_template pt
INNER JOIN product_product pp on pp.product_tmpl_id = pt.id
WHERE pt.active = false
GROUP BY pt.id
HAVING sum((pp.active)::int) != 0
);No verified information in OCA: Configuration, Usage.
Installation instructions, the distribution package, dependencies and configuration steps are not shown because they have not yet been verified in the module documentation for any version.
Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.