Skip to content

[ADD] new_product_type: Implemented custom kit product without BOM dependency.#1325

Draft
adpaw-odoo wants to merge 1 commit into
odoo:19.0from
odoo-dev:19.0-new-product-type-adpaw
Draft

[ADD] new_product_type: Implemented custom kit product without BOM dependency.#1325
adpaw-odoo wants to merge 1 commit into
odoo:19.0from
odoo-dev:19.0-new-product-type-adpaw

Conversation

@adpaw-odoo
Copy link
Copy Markdown

Introduce a new custom module that adds kit functionality to sale orders without requiring the Manufacturing module or Bill of Materials configuration.

WHY this change is being made:
Currently, Odoo only supports kit products through the mrp module which forces non-manufacturing businesses to install unnecessary components. This module bridges that gap by providing a lightweight kit mechanism directly within the sale module.

Technical decisions taken:

  1. Created a standalone custom module inheriting from sale and product to maintain clean separation of custom business logic.
  2. Added is_kit boolean and sub_product_ids Many2many on product.template with explicit relation table to avoid join table name collisions.
  3. Used default_get to pre-populate wizard lines from sub_product_ids on first open and from existing sale.order.line records on reopen.
  4. Used action_confirm_kit with write-or-create pattern to update existing sub-lines in place or create new ones, with total price recalculated as lst_price plus sum of component price times quantity written back to the parent line.
  5. Implemented kit_main_line_id Many2one with ondelete cascade and api.ondelete guard to prevent direct sub-line deletion while allowing parent-triggered cascade.
  6. Used QWeb template inheritance across sale order PDF, portal preview and invoice report to conditionally render kit components based on print_in_report toggle on sale.order.
    Task ID: 4443261

…pendency.

-Added 'is_kit' flag and 'sub_product_ids' M2M relations to product templates.
-Added recursive 'kit_main_line_id' self-relations, 'is_kit_sub_line' states,
and automated cascade-deletion handlers on order lines.
-Build 'sale.kit.wizard' transient model to auto-populate, calculate group
pricing, and map updates back to quotation rows, ensuring the values stay intact
even after re-opening the wizard
-Enforce row-level readonly attributes for generated sub-lines, and introduce a
'print_kit_in_report' toggle.
-Customize logic across Sales Orders, Portal views, and Invoice
 layouts to dynamically filter sub-products based on the parent header flag.
@robodoo
Copy link
Copy Markdown

robodoo commented Jun 4, 2026

Pull request status dashboard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants