TIP: You can type at any time to perform a new search.
BOM Attribute Match
mrp_bom_attribute_match · OCA/manufacture
- Repository
- OCA/manufacture · module folder · Try on Runboat
- Module version
- 1.1.0
- Category
- Manufacturing
- Folder size
- 0.11 MB
- License
- AGPL-3
- Application
- No
- Auto-installable
- No
- Website
- https://github.com/OCA/manufacture
- Last tracking update
- 2026-08-07 08:42:53
- Authors
- Odoo Community Association (OCA), Ooops, Ilyas
- Maintainers
- Odoo Community Association (OCA), Ooops, Ilyas
- Committers
- Weblate, OCA-git-bot, oca-ci, arantxa-s73, eugenio, Vang - Nguyen
- Odoo dependencies
- Python dependencies
- None
- System dependencies
- None
- Required by
- None
- Description
This module addresses the BoM case where the product to manufacture has one attribute with tens or hundreds of values (usually attribute "color", eg: "Configurable Desk" can be produced in 900 different colors). Creating a dynamic BoM currently requires adding one BoM line for each attribute value to match component variant with attribute value (eg: component "Desk board (Green)" to be applied to variant "Green"). This has 3 downsides: - BoM lines proliferation (more error prone) - Difficult to update in case a new attribute value (new color paint) is added - Difficult to update in case base component changes. This module allows to use a product template as component in BoM lines, automatically matching component variant to use in MO line with the attribute value selected for manufacture. Eg: Product template "Desk Board" is added to BoM line for product "Configurable Desk"; match is made on attribute "Color". In MO, if product to manufacture is "Configurable Desk (Steel, Pink)", MO line will have component "Desk Board (Pink)". Using the same BoM, if product to manufacture is "Configurable Desk (Steel, Yellow)", MO line will have component "Desk Board (Yellow)". The flow is valid also if the Component (Product Template) has more than one attribute matching the product to manufacture; in this case, on MO line the component variant will be the one matching multiple attribute values for the product to manufacture. Various checks are in place to make sure this flow is not disrupted: - user cannot add a product in field "Component (Product Template)" which: > does not have matching attributes with product to manufacture > > has a different variant-generating attribute than the product to > manufacture - Adding a new variant-generating attribute to a product used as "Component (Product Template)" raises an error if the attribute is not included in all the products to manufacture where component is referenced. - Removing an attribute used for BoM attribute matching from product to manufacture raises an error. - On a BoM line with Component (Product Template) set, an attribute value of attributes referenced in "Match on attribute" field cannot be used in field "Apply to variant". - If attribute value for matching attribute in manufactured product is not present in component (product template), the BoM line is skipped in MO.
Code Analysis ⓘ
Views touched (1)
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
mrp_bom_form_view |
mrp.bom | form | Inherits mrp.mrp_bom_form_view |
HTTP endpoints (0)
No HTTP endpoints found for this module.
Models touched (6)
New fields (0)
No new fields.
Public methods (1)-
explode(self, product, quantity, picking_type=False, never_attribute_values=False)Explodes the BoM and creates two lists with all the information you need: bom_done and line_done Quantity describes the number of times you need the BoM: so the quantity divided by the number created by the BoM and converted into its UoM
New fields (5)
-
component_template_idMany2one → product.templateargs: 'product.template', 'Component (product template)' -
match_on_attribute_idsMany2many → product.attributecompute='_compute_match_on_attribute_ids'store=Truestring='Match on Attributes' args: 'product.attribute' -
product_backup_idMany2one → product.producthelp='Technical field to store previous value of product_id' args: 'product.product' -
product_idMany2one → product.productrequired=False args: 'product.product', 'Component' -
product_uom_category_idMany2one → uom.categorycompute='_compute_product_uom_category_id'compute_sudo=Truerelated=None args: 'uom.category'
-
create(self, vals_list)@api.model_create_multi
New fields (0)
No new fields.
Public methods (1)-
action_confirm(self)
New fields (0)
No new fields.
Public methods (0)No public methods.
New fields (0)
No new fields.
Public methods (0)No public methods.
New fields (0)
No new fields.
Public methods (0)No public methods.
Loading…
Loading…
Loading…
- Status
- Open migration PR — not merged yet for this version
- CI status
- green — ready to merge
- Open since
- 95 days ago
- Last activity
- 95 days ago
- Repository
- OCA/manufacture
- Pull request
- [16.0][MIG] mrp_bom_attribute_match (#1790)
- Status
- Open migration PR — not merged yet for this version
- CI status
- green — ready to merge
- Open since
- 307 days ago
- Last activity
- 34 days ago
- Repository
- OCA/manufacture
- Pull request
- [19.0][MIG] mrp_bom_attribute_match: Migration to 19.0. (#1632)