-
-
Notifications
You must be signed in to change notification settings - Fork 621
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] mail_composer_cc_bcc: refactor _generate_template_recipients
[IMP] mail_composer_cc_bcc: refactor _generate_template_recipients 1. Refactor _generate_template_recipients 2. Fix invalid-email-address for Bcc - In standard, Bcc key in dict message was stripped in https://github.com/odoo/odoo/blob/4394940a09900aa5b42cbc05355880598608d1b6/odoo/addons/base/models/ir_mail_server.py#L676 - Duplicate the key to retain for later assertion
- Loading branch information
Showing
8 changed files
with
65 additions
and
224 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from . import mail_compose_message | ||
from . import mail_template_preview |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright 2024 Camptocamp | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
from odoo.addons.mail.wizard.mail_template_preview import MailTemplatePreview | ||
|
||
|
||
class MailTemplatePreview(models.TransientModel): | ||
_inherit = "mail.template.preview" | ||
|
||
_MAIL_TEMPLATE_FIELDS = MailTemplatePreview._MAIL_TEMPLATE_FIELDS + ["email_bcc"] | ||
|
||
email_bcc = fields.Char( | ||
"Bcc", | ||
compute="_compute_mail_template_fields", | ||
help="Blind Carbon copy recipients", | ||
) |
12 changes: 12 additions & 0 deletions
12
mail_composer_cc_bcc/wizards/mail_template_preview_view.xml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<record model="ir.ui.view" id="mail_template_preview_view_form_inherited"> | ||
<field name="model">mail.template.preview</field> | ||
<field name="inherit_id" ref="mail.mail_template_preview_view_form" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//field[@name='email_cc']" position="after"> | ||
<field name="email_bcc" invisible="not email_bcc" /> | ||
</xpath> | ||
</field> | ||
</record> | ||
</odoo> |