The end datetime is not timezoned in _adjust_to_calendar before defining the search_range and using the _get_closest_work_time method. Since _get_closest_work_time will timezone the timestamp received to start searching, the search interval needs to refer to the same end timestamp to avoid erratic behaviors. Task-2628876 closes odoo/odoo#79049 X-original-commit: cbf0cb6e210959b3ceea554ec68957416a125141 Related: odoo/enterprise#21915 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com> Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>