Product Abc Classification
product_abc_classification · OCA/product-attribute
-
Security25/25No findings
-
Activity25/25Last human commit 5 months ago
-
Required by15/251 module depends on it
-
Maturity25/25In 4 Odoo series since 13.0
Heuristic over the facts below, not an audit · How it's computed
Migration considerations
AbcClassificationLevel— Migrating to 19.0: `_sql_constraints` is ignored and its constraints are silently not created: declare `models.Constraint` attributes instead. migration-sql-constraints · sourceAbcClassificationProductLevel— Migrating to 19.0: `_sql_constraints` is ignored and its constraints are silently not created: declare `models.Constraint` attributes instead. migration-sql-constraints · sourceAbcClassificationProfile— Migrating to 19.0: `_sql_constraints` is ignored and its constraints are silently not created: declare `models.Constraint` attributes instead. migration-sql-constraints · source- Raw `cr.execute()` INSERT/UPDATE/DELETE bypasses the ORM (no compute/constrains/tracking/mail): `UPDATE %(table)s SET manual_level_id = computed_level_id WHERE profile_id = %(profile_id)s RETURNING id` - re-check the table/column names still match after upgrading. migration-raw-sql-write · source
Migration review checklist, not a compatibility verdict. "Migrating to X.0" applies once you upgrade to that version; "Since X.0" means this version already ignores or rejects that code. Methodology
Description
This modules provides the bases to build ABC analysis (or ABC classification) addons. These classification are used by inventory management teams to help identify the most important products in their portfolio and ensure they prioritize managing them above those less valuable.
Managers will create a profile with several levels (percentages) and then the profiled products will automatically get a corresponding level using the ABC classification.
The addon product_abc_classification_sale_stock defines a computation profile based on the number of sale order line delivered by product.
Dependencies
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 8
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
abc_classification_product_level_form_view |
abc.classification.product.level.form (in product_abc_classification) | abc.classification.product.level | form | New |
abc_classification_product_level_search_view |
abc.classification.product.level.search (in product_abc_classification) | abc.classification.product.level | search | New |
abc_classification_product_level_tree_view |
abc.classification.product.level.tree (in product_abc_classification) | abc.classification.product.level | list | New |
abc_classification_profile_form_view |
abc.classification.profile.form (in product_abc_classification) | abc.classification.profile | form | New |
abc_classification_profile_tree_view |
abc.classification.profile.tree (in product_abc_classification) | abc.classification.profile | list | New |
product_product_form_view |
product.product.form (ABC Classification) | product.product | form | Inherits product.product_normal_form_view |
product_template_form_view |
product.template.form (ABC Classification) | product.template | form | Inherits product.product_template_form_view |
view_product_category_form |
product.category.form - product_abc_classification | product.category | form | Inherits product.product_category_form_view |
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 6
-
nameCharhelp='Classification A, B or C'required=True -
percentageFloatdefault=0.0required=Truestring='% Indicator' -
percentage_productsFloatdefault=0.0required=Truestring='% Products' -
profile_idMany2one → abc.classification.profileondelete='cascade' args: 'abc.classification.profile'
No public methods.
-
allowed_profile_idsMany2many → abc.classification.profilecomodel_name='abc.classification.profile'related='product_id.abc_classification_profile_ids' -
company_idMany2one → res.companycompute='_compute_company_id'index=Truereadonly=Truestore=True args: 'res.company' -
computed_level_idMany2one → abc.classification.levelreadonly=Truestring='Computed classification level' args: 'abc.classification.level' -
flagBooleancompute='_compute_flag'default=Falseindex=Truestore=Truestring='If True, this means that the manual classification is different from the computed one' -
level_idMany2one → abc.classification.levelcompute='_compute_level_id'domain="[('profile_id', '=', profile_id)]"store=Truestring='Classification level' args: 'abc.classification.level' -
manual_level_idMany2one → abc.classification.leveldomain="[('profile_id', '=', profile_id)]"string='Manual classification level'tracking=True args: 'abc.classification.level' -
product_idMany2one → product.productcheck_company=Trueindex=Trueondelete='cascade'required=Truestring='Product' args: 'product.product' -
product_tmpl_idMany2one → product.templateindex=Truereadonly=Truestring='Product template' args: 'product.template' -
profile_idMany2one → abc.classification.profilecheck_company=Truerequired=Truestring='Profile' args: 'abc.classification.profile' -
profile_typeSelectionreadonly=Truerelated='profile_id.profile_type'store=True
-
create(self, vals_list)@api.model_create_multi -
write(self, vals)We apply the manual level to the product level if computed level is modified and only for profiles with auto_apply_computed_value = =True
-
auto_apply_computed_valueBooleandefault=Falsehelp='Check this if you want to apply the computed level on each product that has this profile.' -
company_idMany2one → res.companycomodel_name='res.company'string='Company' -
level_idsOne2many → abc.classification.levelcomodel_name='abc.classification.level'inverse_name='profile_id' -
nameCharrequired=True -
periodIntegerdefault=365required=Truestring='Period on which to compute the classification (Days)' -
product_countIntegercompute='_compute_product_count'readonly=True -
product_variant_idsMany2many → product.productcolumn1='profile_id'column2='product_id'comodel_name='product.product'index=Truerelation='abc_classification_profile_product_rel' -
profile_typeSelectionindex=Truerequired=Trueselection=[('manual', 'Manual')]string='Type of ABC classification'
-
action_view_products(self) -
copy_data(self, default=None) -
write(self, vals)
-
abc_classification_profile_idsMany2many → abc.classification.profilecolumn1='categ_id'column2='profile_id'comodel_name='abc.classification.profile'index=Truerelation='abc_classification_profile_product_categ_rel'
-
update_product_abc_classification_profile(self)
-
abc_classification_product_level_idsOne2many → abc.classification.product.levelindex=Trueinverse_name='product_id' args: 'abc.classification.product.level' -
abc_classification_profile_idsMany2many → abc.classification.profilecheck_company=Truecolumn1='product_id'column2='profile_id'comodel_name='abc.classification.profile'index=Truerelation='abc_classification_profile_product_rel' -
abc_classification_profile_updatable_from_categoryBooleandefault=True
-
create(self, vals_list)@api.model_create_multi -
write(self, vals)
-
abc_classification_product_level_idsOne2many → abc.classification.product.levelcompute='_compute_abc_classification_product_level_ids'inverse='_inverse_abc_classification_product_level_ids'inverse_name='product_tmpl_id'store=True args: 'abc.classification.product.level' -
abc_classification_profile_idsMany2many → abc.classification.profilecheck_company=Truecompute='_compute_abc_classification_profile_ids'inverse='_inverse_abc_classification_profile_ids'store=True args: 'abc.classification.profile'
No public methods.
Loading…
Loading…
Loading…
Loading…