Browse Source

[11.0][MIG] mail_debrand

pull/321/head
Lois Rilo 7 years ago
committed by Graeme Gellatly
parent
commit
0332039c33
  1. 5
      mail_debrand/README.rst
  2. 1
      mail_debrand/__init__.py
  3. 3
      mail_debrand/__manifest__.py
  4. 1
      mail_debrand/models/__init__.py
  5. 5
      mail_debrand/models/mail_template.py
  6. 1
      mail_debrand/tests/__init__.py
  7. 3
      mail_debrand/tests/test_mail_debrand.py

5
mail_debrand/README.rst

@ -1,4 +1,4 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
@ -21,7 +21,7 @@ To use this module, you need to:
.. 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/10.0
:target: https://runbot.odoo-community.org/runbot/205/11.0
Known issues / Roadmap
@ -50,6 +50,7 @@ Contributors
* Jordi Ballester Alomar <jordi.ballester@eficent.com>
* Darshan Patel <darshan.patel.serpentcs@gmail.com>
* Pedro M. Baeza <pedro.baeza@tecnativa.com>
* Lois Rilo <lois.rilo@eficent.com>
Images
------

1
mail_debrand/__init__.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import models

3
mail_debrand/__openerp__.py → mail_debrand/__manifest__.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Tecnativa - Jairo Llopis
# Copyright 2017 SerpentCS - Darshan Patel
# Copyright 2017 Tecnativa - Pedro M. Baeza
@ -7,7 +6,7 @@
{
"name": "Mail Debrand",
"summary": "Remove Odoo branding in sent emails",
"version": "10.0.1.0.0",
"version": "11.0.1.0.0",
"category": "Social Network",
"website": "https://www.tecnativa.com",
"author": "Tecnativa, "

1
mail_debrand/models/__init__.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import mail_template

5
mail_debrand/models/mail_template.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
@ -35,9 +34,9 @@ class MailTemplate(models.Model):
template_txt, model, res_ids, post_process=post_process,
)
if post_process and self.env.context.get('mail_debrand'):
if isinstance(res, basestring):
if isinstance(res, str):
res = self._debrand_body(res)
else:
for res_id, body in res.iteritems():
for res_id, body in res.items():
res[res_id] = self._debrand_body(body)
return res

1
mail_debrand/tests/__init__.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import test_mail_debrand

3
mail_debrand/tests/test_mail_debrand.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
@ -23,4 +22,4 @@ class TestMailDebrand(common.SavepointCase):
res = self.template.generate_email(
self.env.user.ids, fields=['body_html'],
)
self.assertNotIn('using', res[res.keys()[0]])
self.assertNotIn('using', res[[*res.keys()][0]])
Loading…
Cancel
Save