Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
177 Представления

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.


Аватар
Отменить
Лучший ответ

Hi Ravi,

I encountered the same quite recently and clarified it with Odoo support. It's not a bug but a messed up logic.

The consumption of components in a BOM are relative to the set BOM quantity.

BUT the duration is always based on 1 piece NOT relative to the set BOM quantity.

So, with your setting, Odoo things it takes 60min to produce 1 piece. You want to produce 2.000 pieces, ergo 60 * 2.000 = 120.000min.


This is a big issue, if your duration per piece is so low that you cannot really set it up in 00:00min. Unfortunately, Odoo still does not understand what real mass production means.

The work around we found is already in your scenarios: To "misuse" the capacity setting in case you do not need it for anything else. If you set the Capacity to the same value as the BOM quantity the math is done correctly.

BR
   Alexander

Аватар
Отменить
Related Posts Ответы Просмотры Активность
0
февр. 24
1582
1
сент. 24
2752
1
авг. 24
2675
1
янв. 23
3625
3
янв. 23
11581