Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions hr_shift_ical/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
=====================================
Employees Shifts - Personal iCalendar
=====================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:778ec09240e767a17507a4d2da52155f66bc87a76aef821dfa2150592b2d5730
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fshift--planning-lightgray.png?logo=github
:target: https://github.com/OCA/shift-planning/tree/18.0/hr_shift_ical
:alt: OCA/shift-planning
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/shift-planning-18-0/shift-planning-18-0-hr_shift_ical
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/shift-planning&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Publish each employee's shift planning as a personal read-only iCalendar
feed via base_ical. Every internal user can generate a personal URL from
their preferences and subscribe to it from Google Calendar, Apple
Calendar or Outlook. Each user only sees their own shifts.

**Table of contents**

.. contents::
:local:

Usage
=====

1. Open your user preferences and go to the *iCalendar URLs* section.
2. Generate a URL for the *My shifts* calendar; you will be asked to
re-enter your password.
3. Paste the URL in the *Add calendar by URL* option of your calendar
client.

By default, the feed exposes shifts from 30 days in the past to 90 days
in the future. An administrator can adjust the window by editing the *My
shifts* calendar record's domain (*Technical › iCalendar › Calendars*).

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/shift-planning/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/shift-planning/issues/new?body=module:%20hr_shift_ical%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* INVITU

Contributors
------------

- Cyril VINH-TUNG <<cyril@invitu.com>>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/shift-planning <https://github.com/OCA/shift-planning/tree/18.0/hr_shift_ical>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions hr_shift_ical/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
16 changes: 16 additions & 0 deletions hr_shift_ical/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2026 INVITU (<https://www.invitu.com>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Employees Shifts - Personal iCalendar",
"summary": "Publish employee shifts as a personal read-only iCalendar feed",
"version": "18.0.1.0.0",
"development_status": "Alpha",
"author": "INVITU, Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/shift-planning",
"category": "Human Resources/Shifts",
"depends": ["hr_shift", "base_ical"],
"data": [
"data/base_ical.xml",
],
}
22 changes: 22 additions & 0 deletions hr_shift_ical/data/base_ical.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2026 INVITU (<https://www.invitu.com>) -->
<!-- License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -->
<odoo noupdate="1">
<record id="hr_shift_ical_config" model="base.ical">
<field name="name">My shifts</field>
<field name="model_id" ref="hr_shift.model_hr_shift_planning_line" />
<field name="domain">[
('employee_id.user_id', '=', user.id),
('state', '=', 'assigned'),
('start_time', '&gt;=', (datetime.now() - timedelta(days=30)).strftime('%Y-%m-%d')),
('start_time', '&lt;=', (datetime.now() + timedelta(days=90)).strftime('%Y-%m-%d')),
]</field>
<field
name="expression_uid"
>'hr-shift-line-%s@%s' % (record.id, user.login)</field>
<field name="expression_dtstart">record.start_time</field>
<field name="expression_dtend">record.end_time</field>
<field name="expression_summary">record.template_id.name or 'Shift'</field>
<field name="auto" eval="True" />
</record>
</odoo>
1 change: 1 addition & 0 deletions hr_shift_ical/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import base_ical
14 changes: 14 additions & 0 deletions hr_shift_ical/models/base_ical.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2026 INVITU (<https://www.invitu.com>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from datetime import datetime, timedelta

from odoo import models


class BaseIcal(models.Model):
_inherit = "base.ical"

def _get_eval_domain_context(self):
res = super()._get_eval_domain_context()
res.update({"datetime": datetime, "timedelta": timedelta})
return res
3 changes: 3 additions & 0 deletions hr_shift_ical/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
1 change: 1 addition & 0 deletions hr_shift_ical/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Cyril VINH-TUNG <\<cyril@invitu.com\>>
1 change: 1 addition & 0 deletions hr_shift_ical/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Publish each employee's shift planning as a personal read-only iCalendar feed via base_ical. Every internal user can generate a personal URL from their preferences and subscribe to it from Google Calendar, Apple Calendar or Outlook. Each user only sees their own shifts.
5 changes: 5 additions & 0 deletions hr_shift_ical/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1. Open your user preferences and go to the *iCalendar URLs* section.
2. Generate a URL for the *My shifts* calendar; you will be asked to re-enter your password.
3. Paste the URL in the *Add calendar by URL* option of your calendar client.

By default, the feed exposes shifts from 30 days in the past to 90 days in the future. An administrator can adjust the window by editing the *My shifts* calendar record's domain (*Technical › iCalendar › Calendars*).
Loading
Loading