odoo/odoo#218310

Created by Vincent Ethan
Merged at ba81677885d8a75b77b77d47856860d1d0c8047c

Statuses:

label
odoo-dev:16.0-opw-4795463-workcenter-oee-no-intermediary-rounding
head
22d9cd02f7269b60c29913aac03e6c32c5fcaa00
merged
4 days ago by Logistics, Quentin Wolfs (quwo)
odoo/odoo
17.0 #218310
18.0 #232730 missing r+
saas-18.2
saas-18.3
saas-18.4
19.0
master

[FIX] mrp: dont compute oee with intermediary rounding

Current behavior:
The form view for a workcenter has an OEE smart button which can display a different value from the real OEE displayed by the mrp_workcenter_productivity_report_oee displayed when actually clicking the button and looking at the report.

Expected behavior:
Same values

Steps to reproduce:
1. Make a workcenter and a BoM with an operation performed at the workcenter

  1. Use the BoM in an MO such that there is some un-productive time (e.g., recorded production duration takes longer than expected duration)
    * example: 0:20 expected, 1:01 actual

  2. Go to the workcenter list view -> click on the created workcenter -> look at OEE smart button display value -> click on it to see report -> report values are different

Cause of the issue:
the oee field on the workcenter is computed with rounded intermediary blocked_time and productive_time values, the actual report uses the raw values.

Fix:
Don't use the rounded intermediary values in computing oee.

Post-this-diff, we actually do one less _read_group (along with computing a more accurate field value).

opw-4795463