diff --git a/addons/base_calendar/wizard/base_calendar_set_exrule.py b/addons/base_calendar/wizard/base_calendar_set_exrule.py index febfb39e1ef..ab458c8f7f5 100644 --- a/addons/base_calendar/wizard/base_calendar_set_exrule.py +++ b/addons/base_calendar/wizard/base_calendar_set_exrule.py @@ -82,12 +82,11 @@ class base_calendar_set_exrule(osv.osv_memory): @param uid: the current user’s ID for security checks, @param fields: List of fields for default value @param context: A standard dictionary for contextual values - """ - crm_obj = self.pool.get('crm.meeting') - for meeting in crm_obj.browse(cr, uid, context.get('active_ids', [])): - if not meeting.rrule: - raise osv.except_osv(_("Warning !"), _("Please Apply Recurrency after Apply Exception Rule")) + event_obj = self.pool.get(context.get('active_model')) + for event in event_obj.browse(cr, uid, context.get('active_ids', [])): + if not event.rrule: + raise osv.except_osv(_("Warning !"), _("Please Apply Recurrency before applying Exception Rule.")) return False def compute_exrule_string(self, cr, uid, ids, context=None): diff --git a/addons/caldav/calendar.py b/addons/caldav/calendar.py index 3e4701a08d5..409ffa6b5ad 100644 --- a/addons/caldav/calendar.py +++ b/addons/caldav/calendar.py @@ -277,11 +277,7 @@ class CalDAV(object): % (model_obj._table, data[map_field])) r_ids = map(lambda x: x[0], cr.fetchall()) if r_ids: - rdata = self.pool.get(model).read(cr, uid, r_ids) - event_obj = self.pool.get('basic.calendar.event') - rcal = event_obj.export_cal(cr, uid, rdata, context=context) - for revents in rcal.contents['vevent']: - ical.contents['vevent'].append(revents) + rcal = self.export_cal(cr, uid, r_ids, 'vevent', context=context) if data.get('recurrent_uid', None): uidval = openobjectid2uid(cr, data['recurrent_uid'], model) vevent.add('uid').value = uidval