[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] e9bc5b9f36
closes odoo/odoo#99665
X-original-commit: efa48d90839b7bd8b5638f352d7846339e360ac2
Signed-off-by: Adrien Widart <awt@odoo.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user