[ADD][WIP]Radicale Odoo Storage : event recurrency handling
This commit is contained in:
parent
dc3657393d
commit
671962ca5c
@ -21,10 +21,11 @@
|
||||
# 1. OK : Implement readonly from Odoo only
|
||||
# 2. OK : Implement contacts first (and so vcf)
|
||||
# 3. OK : Implement unique events (.ics) and timezone
|
||||
# 4. Implement notifications for events
|
||||
# 5. Implement recurrent events
|
||||
# 6. Begin write (two way) for contacts
|
||||
# 7. Begin write (two way) for calendar
|
||||
# 4. OK : Implement notifications for events
|
||||
# 5. OK : Implement recurrent events
|
||||
# 6. Offer two (or more) calendar : own events, events where I'm attended and all readable events
|
||||
# 7. Begin write (two way) for contacts
|
||||
# 8. Begin write (two way) for calendar
|
||||
|
||||
|
||||
from contextlib import contextmanager
|
||||
@ -130,7 +131,10 @@ class Collection(BaseCollection):
|
||||
def get_events_from_odoo(cls, login):
|
||||
""" Gets all events available from one Odoo login """
|
||||
cls.logger.info('Get events for Odoo user %s' % login)
|
||||
cls.odoo.env.context.update({'virtual_id': False}) # Only real events
|
||||
event_ids = cls.odoo.env['calendar.event'].search([])
|
||||
# WARNING: Odoo does not remove from database deleted recurrent events...
|
||||
# Should be fixed on Odoo side and will be fixed via 2way here too
|
||||
return ['calendar.event:%s' % eid for eid in event_ids]
|
||||
|
||||
def sync(self, old_token=None):
|
||||
@ -219,6 +223,8 @@ class Collection(BaseCollection):
|
||||
action = 'DISPLAY' if alarm.type == 'notification' else 'EMAIL'
|
||||
valarm.add('action').value = action
|
||||
valarm.add('trigger').value = timedelta(minutes=-alarm.duration_minutes)
|
||||
if event.recurrency:
|
||||
cal.vevent.add('rrule').value = event.rrule
|
||||
cal.vevent.add('uid').value = href
|
||||
cal.vevent.add('rev').value = last_modified
|
||||
cal.add('rev').value = last_modified
|
||||
|
Loading…
Reference in New Issue
Block a user