Ir al contenido
Menú
Se marcó esta pregunta

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

  1. Create a Work Center
    • Capacity = 1
    • Time Efficiency = 100%
    • Working Hours = Standard 40h/week
  2. Create a BoM
    • Product Qty = 1000
    • Add one Operation → Duration Computation = Set duration manually
    • Duration (minutes) = 60
    • Work Center = the one created above
  3. 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)

CapacityExpected DurationStatusComment
1120 min (2 h)✅ Correct formulaOne batch per cycle
200060 min (1 h)✅ CorrectParallel batch fits in one cycle
400060 min (1 h)✅ CorrectLess than capacity → one cycle
1 (bug case)120000 h❌ WrongMinutes 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.


Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
feb 24
1566
1
sept 24
2724
1
ago 24
2651
1
ene 23
3599
3
ene 23
11540