Skip to content

[T3647] Double e-mails for new requests and Muskathlon registrations - #2202

Merged
ecino merged 2 commits into
18.0from
T3647-double-emails
Nov 4, 2026
Merged

ecino merged 2 commits into
18.0from
T3647-double-emails

Conversation

@danpa32

@danpa32 danpa32 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

[T3647] Double e-mails for new requests and Muskathlon registrations

Branch T3647-double-emails, based on origin/18.0, in two repositories (independent, they can be merged in any order):

  • compassion-modules: 33677b02 No "assigned" e-mail for requests created by e-mail, 2cb102ca merge of the latest 18.0
  • compassion-website: 13289e11 Muskathlon: one e-mail per new registration

Problem

Requests

Every time a website form (e.g. "Ich will mithelfen") or an e-mail creates a request, its responsible receives two e-mails about the same request:

  1. from OdooBot, "You have been assigned to …", with only a "View Request" button;
  2. the incoming e-mail itself, with the form content and a "View Request" button.

Muskathlon registrations

For each new Muskathlon registration, the event responsible receives two e-mails:

  1. the event name as subject, with only "New registration: " (a note posted on the event);
  2. " - New Muskathlon registration", with all the registration details (posted on the registration).

Cause

Requests

The website forms send an e-mail to an Odoo alias, which creates a crm.claim request. 30 request aliases set a responsible in their defaults (user_id), among them all the website forms (participate, church visit, film, trips, newsletter…). Creating a record with a responsible is standard Odoo behaviour with two effects:

  • the responsible is added as a follower and gets the "You have been assigned" notice (mail.thread._message_auto_subscribe_notify);
  • the incoming e-mail is then posted on the request, and the responsible receives it as a follower.

Muskathlon registrations

Every new event registration posts a one-line "New registration" note on its event, for the event's followers and responsible (website_event_compassion, _notify_new_registration). For a Muskathlon, muskathlon also posts the details e-mail on the registration, to the event's followers. The responsible follows the event, so they get both.

Change

crm_request: crm.claim.message_new() creates the request with mail_auto_subscribe_no_notify. The responsible still follows the request and receives the incoming e-mail, which holds the details and the "View Request" button; the separate "assigned" notice is no longer sent for these requests. Assigning a request by hand (form, assign wizard) still sends the notice.

muskathlon:

  • Muskathlon registrations no longer post the one-line "New registration" note on the event: the details e-mail already reaches the same people. Group visits and other events keep the note, their only notice.
  • The event responsible is always added to the followers of a new Muskathlon registration, so they still get the details e-mail when they don't follow the event.

Tests

crm_request/tests/test_request_notifications.py, through the mail gateway (message_process) on an alias with a responsible:

  • the responsible follows the request and gets only the incoming e-mail (without the fix: the "assigned" notice and the e-mail);
  • assigning the request by hand to another user still sends the "assigned" notice.

muskathlon/tests/test_single_registration_email.py:

  • a Muskathlon registration gives the event responsible one message, the details e-mail, and no note on the event (without the fix: both);
  • a responsible who does not follow the event still gets the details e-mail (without the fix: no details e-mail for them);
  • a registration to another kind of event still posts the note on the event.

Manual tests: a registration on a Muskathlon sent its responsible the details e-mail and the one-line event note before the fix, and only the details e-mail with it. An "Ich will mithelfen" e-mail delivered to the site_de_participate alias created a request assigned to its responsible, who received a single e-mail (the form content with "View Request") and no "You have been assigned" e-mail.

Not changed

  • The volunteer form allows a single area of interest (dropdown): the form is on the WordPress website, which only e-mails Odoo. Allowing several choices (checkboxes) has to be done in WordPress; one submission then creates one request.

Deploy

No -u needed (Python only); a restart is enough.

🤖 Generated with Claude Code

A request created by an incoming e-mail (website forms, e-mail aliases)
whose alias sets a responsible sent that person two e-mails: Odoo's
'You have been assigned' notice and the incoming e-mail itself, which
they receive as a follower. The notice is skipped for these requests;
assigning a request by hand still sends it.
@ecino
ecino merged commit c73a4a3 into 18.0 Nov 4, 2026
1 check passed
@ecino
ecino deleted the T3647-double-emails branch November 4, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants