Skip to main content

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.

The Calendar - Import ICS module (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.
Only files with a .ics extension are accepted. Uploading any other format (.csv, .xml, .json, etc.) will raise a ValidationError and abort the import immediately.

Using the Import Wizard

1

Open the wizard

In the Calendar app, go to Configuration → Import Ics File. The import dialog opens as a pop-up form.
2

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.
3

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.
4

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.
5

Run the import

Click Import. The wizard parses the file line by line, converts timezone-aware datetimes to UTC, and creates or updates calendar.event records accordingly. The partner is automatically set to the currently logged-in user’s partner if not already specified.

Wizard Fields

import_ics_file
Binary (required)
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.
import_start_date
Date
default:"None"
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.
import_end_date
Date
default:"None"
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.
do_remove_old_event
Boolean
default:"True"
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.
partner_id
Many2one (res.partner)
default:"Current user's partner"
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 to calendar.event fields:
ICS FieldOdoo FieldNotes
SUMMARYcalendar.event.nameEvent title
DTSTARTcalendar.event.startConverted to UTC if TZID= is present
DTENDcalendar.event.stopConverted to UTC if TZID= is present
UIDcalendar.event.event_identifierUsed for idempotent matching

UID-Based Idempotency

This module extends calendar.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.event record with a matching event_identifier already 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 new calendar.event with the UID stored in event_identifier.
  • Missing UID (cleanup) — after all events are processed, if do_remove_old_event is True, _delete_non_imported_events() finds any calendar.event whose event_identifier is 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.
Because matching is purely UID-based, you can schedule this import to run automatically or re-run it manually as often as needed to keep Odoo in sync with an external calendar feed. Only genuinely changed fields are written on each run, minimising noise in the chatter and audit log.

Timezone Handling

The iCalendar standard allows DTSTART and DTEND lines to carry a TZID= parameter that specifies a named timezone:
DTSTART;TZID=America/New_York:20060101T120000
DTEND;TZID=America/New_York:20060101T130000
Before the wizard parses these values, it detects the TZID= pattern and calls convert_date_to_z() to convert the datetime to UTC, rewriting the line in the standard Z-suffix format:
DTSTART:20060101T170000Z
DTEND:20060101T180000Z
The conversion uses 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 the calendar_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
FieldValue
Modulecalendar_import_ics
Version18.0.1.0.1
AuthorForgeFlow S.L. / Odoo Community Association (OCA)
LicenseAGPL-3
RepositoryOCA/calendar

Build docs developers (and LLMs) love