[FIX]: * caldav: Export calendar with recurrent event

* base_calendar: Fix wrong code in Exrule wizard

bzr revid: rpa@tinyerp.com-20100630094307-n6lucf47o1ixsai4
This commit is contained in:
rpa (Open ERP) 2010-06-30 15:13:07 +05:30
parent 216e257c51
commit 2d6a0e2329
2 changed files with 5 additions and 10 deletions

View File

@ -82,12 +82,11 @@ class base_calendar_set_exrule(osv.osv_memory):
@param uid: the current users 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):

View File

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