odoo/tutorials#1350
Created by Viraj Vasant Hole (vivah)
Blocked
- Merge method
- Review
-
CI
- ci/style: (runtime 1s)
- ci/tutorial: (runtime 115s)
- label
- odoo-dev:19.0-add-product-kit-management-vivah
- head
- 02b8cf3af0a266e70ca1de16b6c65f06b8804ad2
| odoo/tutorials | |
|---|---|
| 19.0 | #1350 missing statuses missing r+ |
| master |
[ADD] product_kit: add kit product management with sale order integration and configuration wizard
Purpose
This module allows users to define products as kits composed of multiple
component products. When added to a sale order, kits can be configured
via a wizard (quantities/prices per component) and automatically explode
into component lines upon order confirmation.
Task
Create a product_kit module under tutorials/ with the following structure:
- product_template: is_kit boolean + kit_product_ids (One2many to components)
- sale_order: kit_lines_count, action_confirm override for kit explosion
- sale_order_line: kit_line_ids/parent_kit_line_id with unlink cascade
- kit.config.wizard: TransientModel for interactive component configuration
- Views: product form (is_kit toggle + Kit Components page), sale order
form (Configure Kit gear icon on lines), wizard form
- Security: model access rights
What Was Done
- Defined product.kit.line model for storing kit component products
- Extended sale.order.line with self-referential kit relationships
- Extended sale.order to auto-explode kits on confirmation
- Built a wizard for adjusting component quantities/prices before confirm
- All views updated with Odoo 19 compatible syntax
How It Works
- Products → mark product as kit, define components with quantities
- Sale Order → add kit product, click gear icon to configure components
- Wizard → adjust component qty/price, confirm → parent becomes section
- Confirm order → component lines generate stock moves, kit line zeroed
Dependencies
- base, sale, product, stock
Compatibility
- Odoo 19 (uses <list> tag, direct invisible attribute)