The Calendar - Import ICS module (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/OCA/calendar/llms.txt
Use this file to discover all available pages before exploring further.
calendar_import_ics) adds a wizard that reads a standard .ics file and synchronises its events with Odoo’s Calendar. Each event is matched by its UID field, so re-running the import updates existing events rather than duplicating them. Events that were previously imported but are no longer present in the file can be cleaned up automatically.
Using the Import Wizard
Open the wizard
In the Calendar app, go to Configuration → Import Ics File. The import dialog opens as a pop-up form.
Upload your .ics file
Click the upload control next to ICS File and select your
.ics file. The file must have a .ics extension — the wizard validates this before processing any data.Set optional date filters
Enter values in Start Import Date and End Import Date to restrict which events are processed. Both fields must be provided for the filter to take effect — if either is absent, all events in the file are imported regardless of date. When both are set, only events whose
DTSTART falls on or after the start date and whose DTEND falls on or before the end date are imported.Choose whether to remove stale events
The Remove old events? toggle is enabled by default. When checked, any event that was previously imported (identified by a non-empty
event_identifier) but is absent from the current file will be cleaned up after the import finishes.Wizard Fields
The
.ics file to upload. This field is required — the wizard cannot proceed without a file. The accompanying hidden import_ics_filename field is used to validate the file extension before any records are touched.Optional lower bound filter. When set together with
import_end_date, only events whose DTSTART date is on or after this value are imported. If either import_start_date or import_end_date is absent, the date filter is skipped entirely and all events in the file are considered.Optional upper bound filter. When set together with
import_start_date, only events whose DTEND date is on or before this value are imported. Both fields must be provided for the filter to take effect.When enabled, events that carry a non-empty
event_identifier (i.e. were previously imported) but whose UID is not present in the current file are cleaned up after the import. The cleanup first removes the selected partner from the event’s partner_ids; if the event then has no remaining attendees, the record is fully deleted.The partner to associate with imported events. Not shown in the wizard form — it is set automatically inside
button_import() to the logged-in user’s partner when no value has been provided. The partner is added to each event’s partner_ids many2many field.ICS Field Mapping
The wizard parses raw iCalendar lines and maps the following properties tocalendar.event fields:
| ICS Field | Odoo Field | Notes |
|---|---|---|
SUMMARY | calendar.event.name | Event title |
DTSTART | calendar.event.start | Converted to UTC if TZID= is present |
DTEND | calendar.event.stop | Converted to UTC if TZID= is present |
UID | calendar.event.event_identifier | Used for idempotent matching |
UID-Based Idempotency
This module extendscalendar.event with a new Char field called event_identifier, which stores the UID value from the imported iCalendar event. This field is the key to idempotent imports:
- Existing UID — if a
calendar.eventrecord with a matchingevent_identifieralready exists, the wizard calls_update_event()and writes only the fields that have changed (start,stop,name,partner_ids). No duplicate record is created. - New UID — if no existing record matches, the wizard calls
_create_event()and inserts a newcalendar.eventwith the UID stored inevent_identifier. - Missing UID (cleanup) — after all events are processed, if
do_remove_old_eventisTrue,_delete_non_imported_events()finds anycalendar.eventwhoseevent_identifieris set but was not present in the current import batch (scoped by the selected partner and the optional date range), then removes the partner from those events or deletes the records entirely.
Timezone Handling
The iCalendar standard allowsDTSTART and DTEND lines to carry a TZID= parameter that specifies a named timezone:
TZID= pattern and calls convert_date_to_z() to convert the datetime to UTC, rewriting the line in the standard Z-suffix format:
dateutil.parser.parse to read the local datetime and pytz.timezone to apply the correct UTC offset, including daylight-saving adjustments. The resulting UTC datetime is then parsed by _parse_date() using the fixed format %Y%m%dT%H%M%SZ.
The
pytz and python-dateutil packages must be installed in your Odoo environment. Add them to your requirements.txt or install them with pip install pytz python-dateutil before activating this module.Security
Access to the import wizard is governed by thecalendar_import_ics.group_calendar_import security group. Members of this group receive full read/write/create/unlink permissions on the calendar.import.ics transient model, as defined in security/ir.model.access.csv.
Module metadata
| Field | Value |
|---|---|
| Module | calendar_import_ics |
| Version | 18.0.1.0.1 |
| Author | ForgeFlow S.L. / Odoo Community Association (OCA) |
| License | AGPL-3 |
| Repository | OCA/calendar |