From fdc2ed1ee6df28d9b63e8ace7b99947100835e3c Mon Sep 17 00:00:00 2001 From: "Touati Djamel (otd)" Date: Wed, 3 Nov 2021 10:59:44 +0000 Subject: [PATCH] [FIX] mrp_workorder: fix the WO planned date MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit we recently fixed this issue via this commit: https://github.com/odoo/odoo/pull/78377/commits/f3bb0dcc013960d6a43b9182b7daa5d33cab5aaa But we forgot to add a “break” in the loop in order to go to the next available interval when the current interval duration has been used the test has been modified to better cover the use case closes odoo/odoo#79361 X-original-commit: b8201b7a523b66cfdbb4a220250608e15d67190c Related: odoo/enterprise#22096 Signed-off-by: Steve Van Essche Signed-off-by: Djamel Touati (otd) --- addons/mrp/models/mrp_workcenter.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/mrp/models/mrp_workcenter.py b/addons/mrp/models/mrp_workcenter.py index 5d969ce6cde..3dcf86f53dc 100644 --- a/addons/mrp/models/mrp_workcenter.py +++ b/addons/mrp/models/mrp_workcenter.py @@ -266,6 +266,8 @@ class MrpWorkcenter(models.Model): else: # Decrease a part of the remaining duration remaining -= interval_minutes + # Go to the next available interval because the possible current interval duration has been used + break return False, 'Not available slot 700 days after the planned start' def action_archive(self):