[ADD] hr_holidays_google_calendar: suppress Google/Outlook invitations on leave approval#64
Closed
mav-adhoc wants to merge 4 commits into
Closed
[ADD] hr_holidays_google_calendar: suppress Google/Outlook invitations on leave approval#64mav-adhoc wants to merge 4 commits into
mav-adhoc wants to merge 4 commits into
Conversation
…press calendar invitations on leave approval When hr_holidays validates a leave it creates a calendar.event with no_mail_to_attendees=True, but calendar sync modules (Google, Outlook) bypass this flag via their own notification mechanisms. - hr_holidays_google_calendar: overrides _google_insert to set send_updates=False when no_mail_to_attendees is in context, preventing Google from emailing attendees when pushing the event. - hr_holidays_microsoft_calendar: overrides _microsoft_values to remove the attendees key from the Graph API payload when no_mail_to_attendees is in context, preventing Outlook from sending invitation emails. Both modules are auto_install glue modules that activate only when the respective calendar sync module is installed alongside hr_holidays.
… unit tests for no_mail_to_attendees fix
Contributor
|
@roboadhoc r+ nobump rebase-ff |
|
Merge method set to rebase and fast-forward. |
roboadhoc
pushed a commit
that referenced
this pull request
Jun 17, 2026
…pproval Part-of: #64 Signed-off-by: Juan Carreras <jc@adhoc.com.ar>
roboadhoc
pushed a commit
that referenced
this pull request
Jun 17, 2026
…press calendar invitations on leave approval When hr_holidays validates a leave it creates a calendar.event with no_mail_to_attendees=True, but calendar sync modules (Google, Outlook) bypass this flag via their own notification mechanisms. - hr_holidays_google_calendar: overrides _google_insert to set send_updates=False when no_mail_to_attendees is in context, preventing Google from emailing attendees when pushing the event. - hr_holidays_microsoft_calendar: overrides _microsoft_values to remove the attendees key from the Graph API payload when no_mail_to_attendees is in context, preventing Outlook from sending invitation emails. Both modules are auto_install glue modules that activate only when the respective calendar sync module is installed alongside hr_holidays. Part-of: #64 Signed-off-by: Juan Carreras <jc@adhoc.com.ar>
roboadhoc
pushed a commit
that referenced
this pull request
Jun 17, 2026
… unit tests for no_mail_to_attendees fix Part-of: #64 Signed-off-by: Juan Carreras <jc@adhoc.com.ar>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
When a time off is approved,
hr_holidayscreates acalendar.eventwithno_mail_to_attendees=True(Odoo does not send emails itself), but calendar sync modules bypass this flag via their own notification mechanisms:google_sync._google_insertusessend_updates=Trueby default → Google sends a native calendar invitation to all attendees, even employees without an Odoo user (added viawork_contact_id)._microsoft_valuesincludesattendeesin the Graph API payload → Outlook sends invitation emails on its side.Fix
Two
auto_installglue modules that activate only when the respective calendar sync module is installed alongsidehr_holidays. Both honour the existingno_mail_to_attendees=Trueflag thathr_holidaysalready sets, giving it priority over the calendar sync notification mechanism.hr_holidays_google_calendar— overridescalendar.event._google_insert:hr_holidays_microsoft_calendar— overridescalendar.event._microsoft_values:The context key
no_mail_to_attendeesis preserved through@after_commit(both sync modules captureself.env.contextbefore deferring execution).Test plan