Skip to content

Commit

Permalink
[10.0] mail_tracking_mass_mailing: Migration to 10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
chienandalu authored and CarlosRoca13 committed Jul 22, 2021
1 parent 0faf32b commit c832802
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 14 deletions.
3 changes: 2 additions & 1 deletion mail_tracking_mass_mailing/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ eamils again to all the recipients, you must duplicate mass mailing.

.. 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/9.0
:target: https://runbot.odoo-community.org/runbot/205/10.0


Bug Tracker
Expand All @@ -58,6 +58,7 @@ Contributors
* Pedro M. Baeza <pedro.baeza@tecnativa.com>
* Antonio Espinosa <antonio.espinosa@tecnativa.com>
* Vicent Cubells <vicent.cubells@tecnativa.com>
* David Vidal <david.vidal@tecnativa.com>

Maintainer
----------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com>
# Copyright 2017 Vicent Cubells - <vicent.cubells@tecnativa.com>
# Copyright 2017 David Vidal - <david.vidal@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "Mail tracking for mass mailing",
"summary": "Improve mass mailing email tracking",
"version": "9.0.1.0.0",
"version": "10.0.1.0.0",
"category": "Social Network",
"website": "http://www.tecnativa.com",
"author": "Tecnativa, "
Expand Down
2 changes: 1 addition & 1 deletion mail_tracking_mass_mailing/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import logging
try:
from openerp.addons.mail_tracking.hooks import column_add_with_value
from odoo.addons.mail_tracking.hooks import column_add_with_value
except ImportError:
column_add_with_value = False

Expand Down
2 changes: 1 addition & 1 deletion mail_tracking_mass_mailing/models/mail_mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright 2017 Vicent Cubells - <vicent.cubells@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import models, api
from odoo import models, api


class MailMail(models.Model):
Expand Down
2 changes: 1 addition & 1 deletion mail_tracking_mass_mailing/models/mail_mail_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright 2017 Vicent Cubells - <vicent.cubells@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import models, fields
from odoo import models, fields


class MailMailStatistics(models.Model):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright 2017 Vicent Cubells - <vicent.cubells@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import models, api, fields
from odoo import models, api, fields


class MailMassMailingContact(models.Model):
Expand Down
2 changes: 1 addition & 1 deletion mail_tracking_mass_mailing/models/mail_tracking_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright 2017 Vicent Cubells - <vicent.cubells@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import models, fields, api
from odoo import models, fields, api


class MailTrackingEmail(models.Model):
Expand Down
2 changes: 1 addition & 1 deletion mail_tracking_mass_mailing/models/mail_tracking_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright 2017 Vicent Cubells - <vicent.cubells@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import api, fields, models
from odoo import api, fields, models


class MailTrackingEvent(models.Model):
Expand Down
14 changes: 9 additions & 5 deletions mail_tracking_mass_mailing/tests/test_mass_mailing.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com>
# Copyright 2017 Vicent Cubells - <vicent.cubells@tecnativa.com>
# Copyright 2017 David Vidal - <david.vidal@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import mock
from openerp.tests.common import TransactionCase
from odoo.tools import mute_logger
from odoo.tests.common import TransactionCase

mock_send_email = ('openerp.addons.base.ir.ir_mail_server.'
'ir_mail_server.send_email')
mock_send_email = ('odoo.addons.base.ir.ir_mail_server.'
'IrMailServer.send_email')


class TestMassMailing(TransactionCase):
Expand All @@ -33,9 +35,10 @@ def setUp(self, *args, **kwargs):
'reply_to_mode': 'email',
})

@mute_logger('odoo.addons.mail.models.mail_mail')
def test_smtp_error(self):
with mock.patch(mock_send_email) as mock_func:
mock_func.side_effect = Warning('Test error')
mock_func.side_effect = Warning('Mock test error')
self.mailing.send_mail()
for stat in self.mailing.statistics_ids:
if stat.mail_mail_id:
Expand All @@ -46,7 +49,8 @@ def test_smtp_error(self):
for track in tracking:
self.assertEqual('error', track.state)
self.assertEqual('Warning', track.error_type)
self.assertEqual('Test error', track.error_description)
self.assertEqual('Mock test error',
track.error_description)
self.assertTrue(self.contact_a.email_bounced)

def test_tracking_email_link(self):
Expand Down
3 changes: 2 additions & 1 deletion mail_tracking_mass_mailing/views/mail_mass_mailing_view.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com>
Copyright 2017 Vicent Cubells - <vicent.cubells@tecnativa.com>
Copyright 2017 David Vidal - <david.vidal@tecnativa.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
<odoo>

Expand All @@ -21,7 +22,7 @@
</record>

<menuitem name="Mail tracking" id="mail_tracking_menu"
parent="base.marketing_menu" sequence="50"/>
parent="mass_mailing.mass_mailing_menu_root" sequence="50"/>

<menuitem name="Emails" id="mail_tracking_email_menu"
parent="mail_tracking_menu" sequence="1"
Expand Down

0 comments on commit c832802

Please sign in to comment.