Hello Odoo Community 👋,
I’m using Odoo 18 Community Edition, and I’ve found a possible bug in the Manufacturing (MRP) module related to Work Order Expected Duration calculation.
Steps to Reproduce
-
Create a Work Center
- Capacity = 1
- Time Efficiency = 100%
- Working Hours = Standard 40h/week
-
Create a BoM
- Product Qty = 1000
- Add one Operation → Duration Computation = Set duration manually
- Duration (minutes) = 60
- Work Center = the one created above
-
Create a Manufacturing Order
- Product Qty = 2000
- Confirm and check Work Orders tab
Actual Result
- The Expected Duration field shows a very large number (e.g., 120000:00) instead of the correct 120 minutes (2 hours).
Expected Result
-
Expected Duration should be 2 hours (since BoM = 1000 → 60 min, MO = 2000 → double quantity).
📊 Comparison of All Scenarios (BoM 1000 Qty / Duration 60 min / MO 2000 Qty)
| Capacity | Expected Duration | Status | Comment |
| 1 | 120 min (2 h) | ✅ Correct formula | One batch per cycle |
| 2000 | 60 min (1 h) | ✅ Correct | Parallel batch fits in one cycle |
| 4000 | 60 min (1 h) | ✅ Correct | Less than capacity → one cycle |
| 1 (bug case) | 120000 h | ❌ Wrong | Minutes treated as hours or seconds → overflow |
Hypothesis
- It seems Odoo treats the BoM operation “Duration (minutes)” as hours (or seconds) internally when computing duration_expected.
- Possibly an issue in addons/mrp/models/mrp_workorder.py under _get_duration_expected or _plan_workorders.
Correct formula should be:
cycles = math.ceil((mo_qty / bom_qty) / max(capacity, 1)) expected_minutes = cycles * duration_minutes duration_expected = expected_minutes / 60.0
Environment
- Odoo 18.0 CE (fresh DB, no custom MRP changes)
- Manufacturing module only
- Tested on Linux + PostgreSQL 15
Request
Could someone from Odoo or the community please confirm whether this is a known bug or a new regression in Odoo 18 CE?
If confirmed, I’d like to raise a GitHub issue or propose a small patch.