Browse Source

Migration of base_mail_bcc

pull/365/head
fkantelberg 6 years ago
parent
commit
1dd549e2e0
  1. 58
      base_mail_bcc/README.rst
  2. 2
      base_mail_bcc/__init__.py
  3. 8
      base_mail_bcc/__manifest__.py
  4. 4
      base_mail_bcc/demo/mail_bcc_demo.xml
  5. 2
      base_mail_bcc/models/__init__.py
  6. 14
      base_mail_bcc/models/ir_mail_server.py
  7. 2
      base_mail_bcc/readme/DESCRIPTION.rst
  8. 4
      base_mail_bcc/readme/INSTALL.rst
  9. 2
      base_mail_bcc/tests/__init__.py
  10. 4
      base_mail_bcc/tests/test_base_mail_bcc.py

58
base_mail_bcc/README.rst

@ -1,58 +0,0 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
==============
BCC all emails
==============
This module extends the email mechanism to allow for sending a blind carbon copy (BCC)
of all outgoing emails to configurable e-mail addresses.
Configuration
=============
To configure this module, you need to:
* Go to Settings > Parameters > System Parameters
* Create a new entry with key `base_mail_bcc.bcc_to` and set the desired e-mail addresses for BCC as value. This value must be a comma-separated list of valid e-mail addresses.
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/205/8.0
Bug Tracker
===========
Bugs are tracked on `GitHub Issues
<https://github.com/OCA/social/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smashing it by providing a detailed and welcomed feedback.
Credits
=======
Images
------
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
Contributors
------------
* Thomas Rehn <thomas.rehn@initos.com>
Maintainer
----------
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
This module is maintained by the OCA.
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
To contribute to this module, please visit https://odoo-community.org.

2
base_mail_bcc/__init__.py

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2014-2016 Thomas Rehn (initOS GmbH)
# © 2014-2019 Thomas Rehn (initOS GmbH)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import models from . import models

8
base_mail_bcc/__openerp__.py → base_mail_bcc/__manifest__.py

@ -1,18 +1,14 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2014-2016 Thomas Rehn (initOS GmbH)
# © 2014-2019 Thomas Rehn (initOS GmbH)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{ {
"name": "BCC all emails", "name": "BCC all emails",
"version": "8.0.1.0.0",
"version": "10.0.1.0.0",
"depends": ["base"], "depends": ["base"],
'author': 'initOS GmbH, Odoo Community Association (OCA)', 'author': 'initOS GmbH, Odoo Community Association (OCA)',
"category": "Tools", "category": "Tools",
'license': 'AGPL-3', 'license': 'AGPL-3',
'data': [
],
'demo': ['demo/mail_bcc_demo.xml'], 'demo': ['demo/mail_bcc_demo.xml'],
'test': [
],
'installable': True, 'installable': True,
'auto_install': False, 'auto_install': False,
} }

4
base_mail_bcc/demo/mail_bcc_demo.xml

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<openerp>
<odoo>
<data noupdate="1"> <data noupdate="1">
<record id="mail_bcc" model="ir.config_parameter"> <record id="mail_bcc" model="ir.config_parameter">
<field name="key">base_mail_bcc.bcc_to</field> <field name="key">base_mail_bcc.bcc_to</field>
<field name="value">root@example.com</field> <field name="value">root@example.com</field>
</record> </record>
</data> </data>
</openerp>
</odoo>

2
base_mail_bcc/models/__init__.py

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2014-2016 Thomas Rehn (initOS GmbH)
# © 2014-2019 Thomas Rehn (initOS GmbH)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import ir_mail_server from . import ir_mail_server

14
base_mail_bcc/models/ir_mail_server.py

@ -1,9 +1,9 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2014-2017 Thomas Rehn (initOS GmbH)
# © 2014-2019 Thomas Rehn (initOS GmbH)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from email.Utils import COMMASPACE from email.Utils import COMMASPACE
from openerp import models, api
from odoo import api, models
class IrMailServer(models.Model): class IrMailServer(models.Model):
@ -34,8 +34,12 @@ class IrMailServer(models.Model):
) )
return super(IrMailServer, self).send_email( return super(IrMailServer, self).send_email(
message, mail_server_id=mail_server_id, smtp_server=smtp_server,
smtp_port=smtp_port, smtp_user=smtp_user,
smtp_password=smtp_password, smtp_encryption=smtp_encryption,
message,
mail_server_id=mail_server_id,
smtp_server=smtp_server,
smtp_port=smtp_port,
smtp_user=smtp_user,
smtp_password=smtp_password,
smtp_encryption=smtp_encryption,
smtp_debug=smtp_debug smtp_debug=smtp_debug
) )

2
base_mail_bcc/readme/DESCRIPTION.rst

@ -0,0 +1,2 @@
This module extends the email mechanism to allow for sending a blind carbon copy (BCC)
of all outgoing emails to configurable e-mail addresses.

4
base_mail_bcc/readme/INSTALL.rst

@ -0,0 +1,4 @@
To configure this module, you need to:
* Go to Settings > Parameters > System Parameters
* Create a new entry with key `base_mail_bcc.bcc_to` and set the desired e-mail addresses for BCC as value. This value must be a comma-separated list of valid e-mail addresses.

2
base_mail_bcc/tests/__init__.py

@ -1,4 +1,4 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2017 initOS GmbH <https://www.initos.com>
# © 2017-2019 initOS GmbH <https://www.initos.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import test_base_mail_bcc from . import test_base_mail_bcc

4
base_mail_bcc/tests/test_base_mail_bcc.py

@ -1,9 +1,9 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# © 2017 initOS GmbH <https://www.initos.com>
# © 2017-2019 initOS GmbH <https://www.initos.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import mock import mock
from openerp.tests.common import TransactionCase
from odoo.tests.common import TransactionCase
class TestBaseMailBcc(TransactionCase): class TestBaseMailBcc(TransactionCase):

Loading…
Cancel
Save