Skip to content
Snippets Groups Projects
Commit cad75ac7 authored by Arnold Moyaux's avatar Arnold Moyaux
Browse files

[FIX] mrp: WO duration nondeterministic


Usecase to reproduce:
- Set operation time base on last workorder
- Create 2 MO
- On first MO, set 15min as duration
- On second MO, set 10min as duration
- Validate both MO at the same time
- The duraction expected on the operation could be now 10 or 15min

It happens because the search in the compute is only base on date.
And when both MO are validated at the same time, it's not enough

closes odoo/odoo#131169

Signed-off-by: default avatarArnold Moyaux (arm) <arm@odoo.com>
parent cbf590bf
No related branches found
No related tags found
No related merge requests found
......@@ -65,7 +65,7 @@ class MrpRoutingWorkcenter(models.Model):
('qty_produced', '>', 0),
('state', '=', 'done')],
limit=operation.time_mode_batch,
order="date_finished desc")
order="date_finished desc, id")
# To compute the time_cycle, we can take the total duration of previous operations
# but for the quantity, we will take in consideration the qty_produced like if the capacity was 1.
# So producing 50 in 00:10 with capacity 2, for the time_cycle, we assume it is 25 in 00:10
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment