diff --git a/addons/calendar/calendar.py b/addons/calendar/calendar.py index 5da9104b6a8..0c38539d677 100644 --- a/addons/calendar/calendar.py +++ b/addons/calendar/calendar.py @@ -1267,7 +1267,7 @@ class calendar_event(osv.Model): """ if data['interval'] and data['interval'] < 0: raise osv.except_osv(_('warning!'), _('interval cannot be negative.')) - if data['count'] and data['count'] <= 0: + if data['end_type'] == 'count' and int(data['count']) <= 0: raise osv.except_osv(_('warning!'), _('count cannot be negative or 0.')) def get_week_string(freq, data): @@ -1537,6 +1537,7 @@ class calendar_event(osv.Model): recurrent_id=real_event_id, recurrent_id_date=data.get('start'), rrule_type=False, + end_type=False, rrule='', recurrency=False, final_date=datetime.strptime(data.get('start'), DEFAULT_SERVER_DATETIME_FORMAT if data['allday'] else DEFAULT_SERVER_DATETIME_FORMAT) + timedelta(hours=values.get('duration', False) or data.get('duration'))