[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
This commit is contained in:
Serpent Consulting Services 2011-10-27 02:39:02 +05:30
parent 5ef63c30a6
commit 3c0b72eba9
1 changed files with 3 additions and 1 deletions

View File

@ -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