From a32a0534cd999d30a03b8d4416cbd8f99a0a061d Mon Sep 17 00:00:00 2001 From: Adrien Widart Date: Tue, 6 Sep 2022 13:37:34 +0000 Subject: [PATCH] [FIX] mrp: remove time off for a test Since [1], a global time off is created in the demo data. Its date is "today + 8 days". In `mrp`, the test `test_workcenter_timezone` tries to plan some work orders for the next Monday: https://github.com/odoo/odoo/blob/06e33207cdc6608e629a316fdddc35a15e08a3ad/addons/mrp/tests/test_order.py#L1882-L1883 So, if you install the demo data of `hr_holdiays` on Sunday and run the test the day after, the global time off will prevent the slot reservation by the work orders (and so it will lead to a failed test). [1] e9bc5b9f36d8f87c80bfa3ceba9d45b71b109606 closes odoo/odoo#99665 X-original-commit: efa48d90839b7bd8b5638f352d7846339e360ac2 Signed-off-by: Adrien Widart --- addons/mrp/tests/test_order.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/mrp/tests/test_order.py b/addons/mrp/tests/test_order.py index 05729b9ce07..07cac7c2d4a 100644 --- a/addons/mrp/tests/test_order.py +++ b/addons/mrp/tests/test_order.py @@ -2068,6 +2068,9 @@ class TestMrpOrder(TestMrpCommon): # Possible working hours are Monday to Friday, from 8:00 to 12:00 and from 13:00 to 17:00 (UTC+7) workcenter = self.workcenter_1 workcenter.resource_calendar_id.tz = 'Asia/Bangkok' + # The test will try to plan some WO on next Monday. We need to unlink all + # useless times off to ensure that nothing will disturb the slot reservation + (workcenter.resource_calendar_id.global_leave_ids | workcenter.resource_calendar_id.leave_ids).unlink() bom = self.env['mrp.bom'].create({ 'product_tmpl_id': self.product_1.product_tmpl_id.id,