From 3c0b72eba931c37b3166996887c84c3c7fe108a2 Mon Sep 17 00:00:00 2001 From: Serpent Consulting Services Date: Thu, 27 Oct 2011 02:39:02 +0530 Subject: [PATCH] [FIX] Resource : Added a check to notify the user about configuration mistake lp bug: https://launchpad.net/bugs/881839 fixed bzr revid: support@serpentcs.com-20111026210902-c1h934usmochg2td --- addons/resource/resource.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/resource/resource.py b/addons/resource/resource.py index f90a402946b..99afc28f229 100644 --- a/addons/resource/resource.py +++ b/addons/resource/resource.py @@ -332,9 +332,11 @@ class resource_resource(osv.osv): for week in weeks: res_str = "" day = None - if week_days.has_key(week['dayofweek']): + if week_days.get(week['dayofweek'],False): day = week_days[week['dayofweek']] wk_days[week['dayofweek']] = week_days[week['dayofweek']] + else: + raise osv.except_osv(_('Configuration Error!'),_('Make sure the Working time has been configured with proper week days!')) hour_from_str = convert_timeformat(week['hour_from']) hour_to_str = convert_timeformat(week['hour_to']) res_str = hour_from_str + '-' + hour_to_str