[FIX]: base_calendar: Restricted count and inverval of rrule from negative value

bzr revid: rpa@tinyerp.com-20100415091202-9njp5d36ph3uowxr
This commit is contained in:
rpa (Open ERP) 2010-04-15 14:42:02 +05:30
parent 3d91fc7ea2
commit f225067578
1 changed files with 4 additions and 0 deletions

View File

@ -923,6 +923,10 @@ class calendar_event(osv.osv):
if datas.get('rrule_type') == 'none':
result[event] = False
elif datas.get('rrule_type') == 'custom':
if datas.get('interval', 0) < 0:
raise osv.except_osv('Warning!', 'Interval can not be Negative')
if datas.get('count', 0) < 0:
raise osv.except_osv('Warning!', 'Count can not be Negative')
rrule_custom = self.compute_rule_string(cr, uid, datas,\
context=context)
result[event] = rrule_custom