From 2d6a0e2329abbf2d5269fb9ccd17c80404b2fe6b Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Wed, 30 Jun 2010 15:13:07 +0530 Subject: [PATCH] [FIX]: * caldav: Export calendar with recurrent event * base_calendar: Fix wrong code in Exrule wizard bzr revid: rpa@tinyerp.com-20100630094307-n6lucf47o1ixsai4 --- addons/base_calendar/wizard/base_calendar_set_exrule.py | 9 ++++----- addons/caldav/calendar.py | 6 +----- 2 files changed, 5 insertions(+), 10 deletions(-) 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