From acf22b7bc84164df99046120287ad1f7f5d01783 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 14 Sep 2015 15:12:40 +0200 Subject: [PATCH] [FIX] resource: current_hour in interval_get_multi The minutes of dt_from(start date) must be taken into account by current_hour and not by todo (hours). --- addons/resource/resource.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/resource/resource.py b/addons/resource/resource.py index ec414f2f38a..0ff1fd71468 100644 --- a/addons/resource/resource.py +++ b/addons/resource/resource.py @@ -159,10 +159,10 @@ class resource_calendar(osv.osv): continue dt_leave = self._get_leaves(cr, uid, id, resource) - todo = hours + f_round(float(dt_from.minute)/60, 2) + todo = hours result = [] maxrecur = 100 - current_hour = dt_from.hour + current_hour = dt_from.hour + f_round(float(dt_from.minute)/60, 2) while float_compare(todo, 0, 4) and maxrecur: for (hour_from,hour_to) in [(item['hour_from'], item['hour_to']) for item in hours_by_cal[id] if item['dayofweek'] == str(dt_from.weekday())]: h_from = dt_from.replace(hour=int(hour_from), minute=int((hour_from % 1)*60)).replace(tzinfo=tzinfo).astimezone(pytz.UTC)