Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] mrp_multi_level: Missing demand propagation for subcontracting BOMs #1477

Open
marco-lucaf opened this issue Feb 12, 2025 · 0 comments
Labels

Comments

@marco-lucaf
Copy link

Module

mrp_multi_level

Describe the bug

The MRP calculation doesn't propagate demand through subcontracting BOMs. When a product has a subcontracting BOM and is set as "buy" for procurement, the system creates planned purchase orders but doesn't generate demand for its components.

For example:

  • Product A (subcontracted, procurement: buy) contains Product B
  • When there's demand for Product A, the system creates planned purchase order for Product A
  • However, no demand is propagated to Product B and no MRP movements are created for components

To Reproduce

Affected versions:

  • Odoo 16.0
  • mrp_multi_level OCA module

Steps to reproduce the behavior:

  1. Create Product A and set its procurement method as 'buy'
  2. Create a BOM for Product A and set its type as 'subcontract'
  3. Add Product B as component in Product A's BOM
  4. Create some demand for Product A (e.g., through a sale order)
  5. Run MRP calculation
  6. Check MRP movements and planned orders

Expected behavior
When running MRP calculation:

  1. System should create planned purchase orders for Product A
  2. System should propagate demand to Product B
  3. MRP movements should be created for all components in the subcontracting BOM

Additional context
Technical analysis shows the issue is in the _explode_bom_mrp method which currently only processes BOMs for products with 'manufacture' supply method. It should also handle products with subcontracting BOMs, even if their supply method is 'buy'.

The bug affects the basic functionality of MRP planning for subcontracted products, which is a common manufacturing scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant