Files
odoo_source/addons
MerlinGuillaume 4ee367d6ef [FIX] mrp: keep end time and duration consistent when moving work order
When drag and dropping a work order in the Work Orders Planning, the
end time wasn't recomputed. This can make the end time inconsistent with
the duration when the work order spans across a non-working time.

Steps to reproduce:
1. Install Manufacturing
2. Go to Settings > Manufacturing > Operations and enable Work Orders
3. Go to Manufacturing > Master Data > Routings and edit routing
   'Primary Assembly' to last 120:00 minutes
4. Go to Manufacturing > Operations > Manufacturing Orders and create
   one with values:
   - Product: Table Top
   - Plan From: today's date at 11:00:00
5. Save, mark as todo and plan the manufacturing order
6. Go to Manufacturing > Planning > Planning by Workcenter and trigger
   the day view
7. Move the work order to 8 am
8. The work order still lasts for 3 hours (according to its start and
   finish time) even though its expected duration is 2 hours

Solution:
Recompute `date_planned_finished` when we move a work order in the
planning (`date_planned_start` and `date_planned_finished` are passed in
values), and recompute `expected_duration` when we extend it (only one
of them is passed depending on the way we extend the work order).
(`duration_expected` is never passed in values when we manipulate a work
order through the planning)

Problem:
`date_planned_finished` wasn't recomputed when moving the work order in
the planning

opw-2893622

closes odoo/odoo#100988

X-original-commit: 2515482d5a706c65a7d8e27028f43987f17e6e67
Related: odoo/enterprise#31720
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2022-09-23 14:37:07 +02:00
..
2022-09-23 13:34:36 +02:00
2022-09-21 01:29:59 +02:00
2022-09-20 13:48:49 +02:00
2022-09-20 13:48:49 +02:00
2022-09-20 13:48:49 +02:00
2022-09-23 07:21:33 +02:00
2022-09-23 11:22:08 +02:00
2022-09-01 21:25:29 +02:00
2022-09-20 13:48:49 +02:00
2022-09-16 20:51:56 +02:00
2022-09-20 13:48:49 +02:00
2022-09-20 13:48:49 +02:00
2022-09-20 13:48:49 +02:00
…