Skip to content

[18.0][ADD] hr_shift_ical: personal iCalendar feed for employee shifts - #45

Open
cvinh wants to merge 1 commit into
OCA:18.0from
invitu:18.0-add_hr_shift_ical
Open

[18.0][ADD] hr_shift_ical: personal iCalendar feed for employee shifts#45
cvinh wants to merge 1 commit into
OCA:18.0from
invitu:18.0-add_hr_shift_ical

Conversation

@cvinh

@cvinh cvinh commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Publish each employee's shift planning as a personal read-only iCalendar feed, so employees can subscribe to it from Google Calendar, Apple Calendar or Outlook and always see their shifts in the calendar client they use every day.

The module builds on top of base_ical (OCA/server-backend) and only provides:

  • A pre-configured base.ical record targeting hr.shift.planning.line, restricted to the shifts assigned to the connected user's employee and bounded to a rolling window of 30 days in the past and 90 days in the future. auto=True auto-enrolls every internal user, so each one can generate a personal URL from their preferences.
  • A small extension of base.ical._get_eval_domain_context to expose datetime and timedelta so the domain expression can compute the rolling window boundaries.

The feed is strictly read-only and per-user: the domain filter combined with base_ical's with_user(user_id) execution guarantees a compromised URL only exposes its owner's shifts. Tokens are standard res.users.apikeys entries, generated via check_identity (password re-entry) and revocable from the user's API Keys interface.

The window can be adjusted by editing the domain of the "My shifts" calendar in Technical > iCalendar > Calendars.

Publish each employee's shift planning as a personal read-only iCalendar
feed, so employees can subscribe to it from Google Calendar, Apple
Calendar or Outlook and always see their shifts in the calendar client
they use every day.

The module builds on top of base_ical (OCA/server-backend) and only
provides:

- A pre-configured base.ical record targeting hr.shift.planning.line,
  restricted to the shifts assigned to the connected user's employee
  and bounded to a rolling window of 30 days in the past and 90 days
  in the future. auto=True auto-enrolls every internal user, so each
  one can generate a personal URL from their preferences.
- A small extension of base.ical._get_eval_domain_context to expose
  datetime and timedelta so the domain expression can compute the
  rolling window boundaries.

The feed is strictly read-only and per-user: the domain filter
combined with base_ical's with_user(user_id) execution guarantees a
compromised URL only exposes its owner's shifts. Tokens are standard
res.users.apikeys entries, generated via check_identity (password
re-entry) and revocable from the user's API Keys interface.

The window can be adjusted by editing the domain of the "My shifts"
calendar in Technical > iCalendar > Calendars.
@cvinh
cvinh force-pushed the 18.0-add_hr_shift_ical branch from 276cc13 to 4f2ce7b Compare July 22, 2026 02:30
@cvinh
cvinh marked this pull request as draft July 22, 2026 05:02
@cvinh
cvinh marked this pull request as ready for review July 22, 2026 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants