From 64ccd51277d9ec70b84303b71451bf69743e9f2d Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Wed, 13 Nov 2019 15:26:07 +0100 Subject: [PATCH] [ADD] mail_send_bcc --- mail_send_copy/README.rst | 0 mail_send_copy/__init__.py | 1 + mail_send_copy/__manifest__.py | 15 ++++++++++++ mail_send_copy/i18n/fr.po | 27 +++++++++++++++++++++ mail_send_copy/models/__init__.py | 1 + mail_send_copy/models/ir_mail_server.py | 18 ++++++++++++++ mail_send_copy/readme/CONTRIBUTORS.rst | 1 + mail_send_copy/readme/DESCRIPTION.rst | 15 ++++++++++++ mail_send_copy/readme/ROADMAP.rst | 1 + mail_send_copy/static/description/icon.png | Bin 0 -> 3711 bytes 10 files changed, 79 insertions(+) create mode 100644 mail_send_copy/README.rst create mode 100644 mail_send_copy/__init__.py create mode 100644 mail_send_copy/__manifest__.py create mode 100644 mail_send_copy/i18n/fr.po create mode 100644 mail_send_copy/models/__init__.py create mode 100644 mail_send_copy/models/ir_mail_server.py create mode 100644 mail_send_copy/readme/CONTRIBUTORS.rst create mode 100644 mail_send_copy/readme/DESCRIPTION.rst create mode 100644 mail_send_copy/readme/ROADMAP.rst create mode 100644 mail_send_copy/static/description/icon.png diff --git a/mail_send_copy/README.rst b/mail_send_copy/README.rst new file mode 100644 index 000000000..e69de29bb diff --git a/mail_send_copy/__init__.py b/mail_send_copy/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/mail_send_copy/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/mail_send_copy/__manifest__.py b/mail_send_copy/__manifest__.py new file mode 100644 index 000000000..91e081b89 --- /dev/null +++ b/mail_send_copy/__manifest__.py @@ -0,0 +1,15 @@ +# Copyright (C) 2014 - Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + "name": "Mail - Send Email Copy", + "summary": "Send to you a copy of each mail sent by Odoo", + "version": "12.0.1.0.0", + "category": "Social Network", + "author": "GRAP," + "Odoo Community Association (OCA)", + "website": "https://www.github.com/OCA/server-tools", + "license": "AGPL-3", + "depends": ["mail"], + "installable": True, +} diff --git a/mail_send_copy/i18n/fr.po b/mail_send_copy/i18n/fr.po new file mode 100644 index 000000000..94db95fc0 --- /dev/null +++ b/mail_send_copy/i18n/fr.po @@ -0,0 +1,27 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_send_copy +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-13 10:48+0000\n" +"PO-Revision-Date: 2019-11-13 10:48+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: mail_send_copy +#: model:ir.model,name:mail_send_copy.model_ir_mail_server +msgid "Mail Server" +msgstr "Serveur d'email" + +#. module: mail_send_copy +#: model:ir.model,name:mail_send_copy.model_res_users +msgid "Users" +msgstr "Utilisateurs" + diff --git a/mail_send_copy/models/__init__.py b/mail_send_copy/models/__init__.py new file mode 100644 index 000000000..abbcb50bd --- /dev/null +++ b/mail_send_copy/models/__init__.py @@ -0,0 +1 @@ +from . import ir_mail_server diff --git a/mail_send_copy/models/ir_mail_server.py b/mail_send_copy/models/ir_mail_server.py new file mode 100644 index 000000000..67feeac53 --- /dev/null +++ b/mail_send_copy/models/ir_mail_server.py @@ -0,0 +1,18 @@ +# Copyright (C) 2014 - Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import api, models +from email.utils import COMMASPACE + + +class IrMailServer(models.Model): + _inherit = "ir.mail_server" + + @api.model + def send_email(self, message, *args, **kwargs): + if message["Bcc"]: + message["Bcc"] = message["Bcc"].join(COMMASPACE, message["From"]) + else: + message["Bcc"] = message["From"] + return super(IrMailServer, self).send_email(message, *args, **kwargs) diff --git a/mail_send_copy/readme/CONTRIBUTORS.rst b/mail_send_copy/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..e1525ce04 --- /dev/null +++ b/mail_send_copy/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Sylvain LE GAL (https://www.twitter.com/legalsylvain) diff --git a/mail_send_copy/readme/DESCRIPTION.rst b/mail_send_copy/readme/DESCRIPTION.rst new file mode 100644 index 000000000..c0c54bf41 --- /dev/null +++ b/mail_send_copy/readme/DESCRIPTION.rst @@ -0,0 +1,15 @@ +This module extends the functionality of Mail Module to allow users to +receive each mail sent by Odoo, in BCC mode. + +Use Case +-------- + +This feature can be usefull for users: + +* to be sure the mail was sent because Odoo send mail depending of + some partner parameters + +* to have the whole conversation if the partner writes an answer and if + mailbox manages thread by object + +* to be sure smtp server works diff --git a/mail_send_copy/readme/ROADMAP.rst b/mail_send_copy/readme/ROADMAP.rst new file mode 100644 index 000000000..4580be0e0 --- /dev/null +++ b/mail_send_copy/readme/ROADMAP.rst @@ -0,0 +1 @@ +* Add the possibility to select if the mail is sent in "Cc" or in "Bcc" mode. diff --git a/mail_send_copy/static/description/icon.png b/mail_send_copy/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..9414ac9fdfeac29b20500deab9e1c5f5cda26023 GIT binary patch literal 3711 zcmZu!c|4Te7k{jYK_N!gHc9( zMEW{=xZQJec0~mYx*@<7PLNs}=3%e43cL+CECu=sW89oCUm<&0&oGLWUJAbG_tD(o z=8R=*JbhiFsFk?yBqt%${14qT&Z=K76%XgakiL~kp&EBZk?2cqoYb5qx-{6BSd?3!AlIZ)G`0B=vs*gLJ zg1^t~k_Vra+dqhiP?^@#XTqZQ2K#Lsb(dzUY^OQWR5{J~^)Nj$9;0RVxv`w)&`u;n z^y%rTkEf?eu_i*iOftGSC@3hk4Dz(Av%Ou_65dOQEq?^4X-_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