Skip to content

Commit

Permalink
[IMP] improve code for OCA convention
Browse files Browse the repository at this point in the history
  • Loading branch information
liklee-it committed Dec 28, 2024
1 parent e9e2642 commit 6f9b684
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mail_send_copy/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Mail - Send Email Copy",
"summary": "Send to you a copy of each mail sent by Odoo",
"version": "15.0.1.0.1",
"version": "15.0.1.0.0",
"category": "Social Network",
"author": "GRAP," "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/social",
Expand Down
7 changes: 4 additions & 3 deletions mail_send_copy/models/ir_mail_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ def send_email(self, message, *args, **kwargs):
all_bcc = from_addr

# Set the combined Bcc
message.replace_header(
"Bcc", all_bcc
) if "Bcc" in message else message.add_header("Bcc", all_bcc)
if "Bcc" in message:
message.replace_header("Bcc", all_bcc)

Check warning on line 32 in mail_send_copy/models/ir_mail_server.py

View check run for this annotation

Codecov / codecov/patch

mail_send_copy/models/ir_mail_server.py#L32

Added line #L32 was not covered by tests
else:
message.add_header("Bcc", all_bcc)

return super().send_email(message, *args, **kwargs)

0 comments on commit 6f9b684

Please sign in to comment.