diff --git a/hr_holidays_microsoft_calendar/__manifest__.py b/hr_holidays_microsoft_calendar/__manifest__.py index a4ed861e..7f5e9e7f 100644 --- a/hr_holidays_microsoft_calendar/__manifest__.py +++ b/hr_holidays_microsoft_calendar/__manifest__.py @@ -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", @@ -31,7 +31,7 @@ ], "data": [], "demo": [], - "installable": False, + "installable": True, "auto_install": True, "application": False, } diff --git a/hr_holidays_microsoft_calendar/i18n/es.po b/hr_holidays_microsoft_calendar/i18n/es.po new file mode 100644 index 00000000..3b358b92 --- /dev/null +++ b/hr_holidays_microsoft_calendar/i18n/es.po @@ -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" diff --git a/hr_holidays_microsoft_calendar/i18n/hr_holidays_microsoft_calendar.pot b/hr_holidays_microsoft_calendar/i18n/hr_holidays_microsoft_calendar.pot index 536a25eb..8f383132 100644 --- a/hr_holidays_microsoft_calendar/i18n/hr_holidays_microsoft_calendar.pot +++ b/hr_holidays_microsoft_calendar/i18n/hr_holidays_microsoft_calendar.pot @@ -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" @@ -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 "" diff --git a/hr_holidays_microsoft_calendar/tests/__init__.py b/hr_holidays_microsoft_calendar/tests/__init__.py new file mode 100644 index 00000000..1d2a24b0 --- /dev/null +++ b/hr_holidays_microsoft_calendar/tests/__init__.py @@ -0,0 +1 @@ +from . import test_calendar_event diff --git a/hr_holidays_microsoft_calendar/tests/test_calendar_event.py b/hr_holidays_microsoft_calendar/tests/test_calendar_event.py new file mode 100644 index 00000000..366f88f4 --- /dev/null +++ b/hr_holidays_microsoft_calendar/tests/test_calendar_event.py @@ -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": "attendee@example.com"}) + 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")