Skip to content
Closed
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
4 changes: 2 additions & 2 deletions hr_holidays_microsoft_calendar/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
##############################################################################
{
"name": "Holidays Microsoft Calendar",
"version": "19.0.1.0.0",
"version": "20.0.1.0.0",
"category": "Human Resources",
"summary": "Suppress Outlook invitations when approving time off",
"author": "ADHOC SA",
Expand All @@ -31,7 +31,7 @@
],
"data": [],
"demo": [],
"installable": False,
"installable": True,
"auto_install": True,
"application": False,
}
42 changes: 42 additions & 0 deletions hr_holidays_microsoft_calendar/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_holidays_microsoft_calendar
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 20.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-11-05 13:41+0000\n"
"PO-Revision-Date: 2026-11-05 13:41+0000\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"

#. module: hr_holidays_microsoft_calendar
#: model:ir.model,name:hr_holidays_microsoft_calendar.model_calendar_event
msgid "Calendar Event"
msgstr "Evento del calendario"

#. module: hr_holidays_microsoft_calendar
#: model:ir.model.fields,field_description:hr_holidays_microsoft_calendar.field_calendar_event__display_name
msgid "Display Name"
msgstr "Mostrar nombre"

#. module: hr_holidays_microsoft_calendar
#: model:ir.module.module,shortdesc:base.module_hr_holidays_microsoft_calendar
msgid "Holidays Microsoft Calendar"
msgstr "Ausencias Microsoft Calendar"

#. module: hr_holidays_microsoft_calendar
#: model:ir.model.fields,field_description:hr_holidays_microsoft_calendar.field_calendar_event__id
msgid "ID"
msgstr ""

#. module: hr_holidays_microsoft_calendar
#: model:ir.module.module,summary:base.module_hr_holidays_microsoft_calendar
msgid "Suppress Outlook invitations when approving time off"
msgstr "Suprime las invitaciones de Outlook al aprobar ausencias"
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 19.0+e\n"
"Project-Id-Version: Odoo Server 20.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-06-17 15:20+0000\n"
"PO-Revision-Date: 2026-06-17 15:20+0000\n"
"POT-Creation-Date: 2026-11-05 13:40+0000\n"
"PO-Revision-Date: 2026-11-05 13:40+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
Expand All @@ -25,7 +25,17 @@ msgstr ""
msgid "Display Name"
msgstr ""

#. module: hr_holidays_microsoft_calendar
#: model:ir.module.module,shortdesc:base.module_hr_holidays_microsoft_calendar
msgid "Holidays Microsoft Calendar"
msgstr ""

#. module: hr_holidays_microsoft_calendar
#: model:ir.model.fields,field_description:hr_holidays_microsoft_calendar.field_calendar_event__id
msgid "ID"
msgstr ""

#. module: hr_holidays_microsoft_calendar
#: model:ir.module.module,summary:base.module_hr_holidays_microsoft_calendar
msgid "Suppress Outlook invitations when approving time off"
msgstr ""
1 change: 1 addition & 0 deletions hr_holidays_microsoft_calendar/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import test_calendar_event
42 changes: 42 additions & 0 deletions hr_holidays_microsoft_calendar/tests/test_calendar_event.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
from datetime import timedelta

from odoo import fields
from odoo.tests.common import TransactionCase


class TestCalendarEventMicrosoftValues(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
now = fields.Datetime.now()
attendee = cls.env["res.partner"].create({"name": "Attendee", "email": "[email protected]"})
cls.event = cls.env["calendar.event"].create(
{
"name": "Time off",
"start": now,
"stop": now + timedelta(hours=1),
"partner_ids": [(6, 0, attendee.ids)],
}
)
cls.synced_fields = cls.env["calendar.event"]._get_microsoft_synced_fields()

def test_microsoft_values_keeps_attendees_on_a_regular_event(self):
"""Outside a time off nothing changes: Outlook still gets the attendees."""
values = self.event._microsoft_values(self.synced_fields)
self.assertTrue(values["attendees"])

def test_microsoft_values_drops_attendees_for_a_time_off(self):
"""An approved time off reaches Outlook without attendees, so Microsoft does
not send the invitation that hr_holidays asked to suppress.
"""
event = self.event.with_context(no_mail_to_attendees=True)

with self.subTest("the call microsoft_sync makes on create and on write"):
values = event._microsoft_values(self.synced_fields)
self.assertNotIn("attendees", values)
self.assertEqual(values["subject"], "Time off")

with self.subTest("the call calendar.recurrence makes for a series master"):
values = event._microsoft_values(self.synced_fields, initial_values={"type": "seriesMaster"})
self.assertNotIn("attendees", values)
self.assertEqual(values["type"], "seriesMaster")
Loading