Repository navigation
Conversation
Port to 18.0 of 3580f9c (19.0), superseding the context-based composer_recipient_ids handling of 74d4358. The Cc / Bcc are now read from the message itself (recipient_cc_ids / recipient_bcc_ids), never from the context. mail.message gets a single _get_cc_bcc_audience() splitting the audience in To, Cc and hidden Bcc (a partner in To and Cc / Bcc stays To). Every copy shows the same To and Cc headers; Bcc partners and followers reach only their own copy through a Bcc header that Odoo strips before sending. Fixed: - a Cc made one copy too many - with several Bcc only the last one was delivered, X-Odoo-Bcc is gone - Cc recipients got the email once per language - a recipient without email made the whole email fail - a partner in To and Cc got two emails / an empty To - emails sent by the queue or Retry lost the Cc / Bcc handling - Cc / Bcc leaked to other messages posted in the same transaction - internal followers showed in the customer's To and lost the View button: notification groups are no longer merged - template emails posted by Odoo (order confirmation) now get the template Cc / Bcc, also with Default Recipients - with a company default Cc the template Cc was ignored (default_get override removed, defaults come from the compute) - switching template kept the Cc of the previous one - with Default Recipients the composer overwrote a To chosen by the user - replying from the full composer crashed (parent_id.partner_cc_ids) - a logged note was emailed to the company default Cc / Bcc Also: - explicit Cc / Bcc always get an email, even internal users handling notifications in Odoo - company default Cc / Bcc only apply to emails a user writes - messages without Cc / Bcc cost no extra query Adapted to Odoo 18: - _notify_by_email_get_base_mail_values has no recipients_data on 18: _notify_thread_by_email sets a call-scoped context flag when a recipient is a Cc / Bcc, so other messages are not read - no X-Msg-To-Add (Reply-All) header on 18: nothing to strip - no allow_suggested in _generate_template_for_composer on 18: the Default Recipients To comes from Odoo's default recipients - _notify_get_recipients keeps 18's positional msg_vals, _prepare_outgoing_list keeps recipients_follower_status - tests: test_mail_cc_bcc_delivery.py ported (employee made partner manager as on 19.0 MailCommon, process_email_queue(ids=...), 19.0-only header assertions adapted); existing tests updated to the new behaviour, assertions only (no merged notification groups, template Cc replaces the company default, followers hidden) - kept minimal: README / readme fragments and manifest header untouched, only the version is bumped Kept identical to 3580f9c: mail.message._get_cc_bcc_audience, the composer Cc / Bcc compute and _prepare_mail_values_rendered, and the _prepare_outgoing_list logic. Removed as on 19.0: default_get, _notify_get_recipients_classify, _notify_thread, _action_send_mail_comment, _expose_bcc_marker / X-Odoo-Bcc, the composer_recipient_ids context. 482ec1e (19.0 follow-up) is not part of this port. Checks (Odoo 18.0 community, origin/18.0 d89bac4b): - module tests: -i mail_composer_cc_bcc --test-enable --test-tags /mail_composer_cc_bcc -> 0 failed, 0 errors of 57 tests - with sale + account installed, Odoo's own tests still pass: /account:TestAccountMoveSend, /account:TestAccountComposerPerformance, /sale:TestSaleOrder, /sale:TestSaleOrderCancel, /mail:TestMailComposer, /mail:TestMailComposerForm, /mail:TestMailComposerRendering plus the module -> 0 failed, 0 errors of 125 tests - real SMTP (local SMTP server, no mocks), each recipient exactly one delivery, same To / Cc on every copy, no Bcc / X-Odoo-Bcc transmitted, Bcc and followers never in another copy: To + 2 Cc + 2 Bcc with uppercase addresses, mixed languages, internal user in Bcc, follower, partner in To and Cc, mail queue, Retry after SMTP failure, template notification, quotation "Send by email" (template + manual Cc / Bcc), order confirmation with template Cc / Bcc; message without Cc / Bcc keeps Odoo's headers. The same scenarios fail on 74d4358. - pre-commit ruff, ruff-format, pylint-odoo: clean. The pinned oca-gen-addon-readme hook rewrites README.rst / index.html even on the untouched 18.0 files (banner, badge text): pre-existing, left as is Known limits, unchanged by this port (same on 19.0): - Resend from the failure popup (mail.resend.message) delivers once to each recipient without leaking the Bcc, but with Odoo's default per-recipient To and no Cc header - invoices use account.move.send.wizard: the template Cc goes to To and the template Bcc is not sent, as in standard Odoo Co-authored-by: Daan Marchal <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-authored-by: omnigent <[email protected]>
|
The following commit authors need to sign the Contributor License Agreement: |
Contributor
|
Hi @trisdoan, |
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.
No description provided.