mirror of https://github.com/OCA/social.git
[10.0] mail_tracking_mass_mailing: Migration to 10.0
parent
df70ce15fa
commit
72cfa5ac06
|
@ -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
|
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
|
||||||
:alt: Try me on Runbot
|
: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
|
Bug Tracker
|
||||||
|
@ -58,6 +58,7 @@ Contributors
|
||||||
* Pedro M. Baeza <pedro.baeza@tecnativa.com>
|
* Pedro M. Baeza <pedro.baeza@tecnativa.com>
|
||||||
* Antonio Espinosa <antonio.espinosa@tecnativa.com>
|
* Antonio Espinosa <antonio.espinosa@tecnativa.com>
|
||||||
* Vicent Cubells <vicent.cubells@tecnativa.com>
|
* Vicent Cubells <vicent.cubells@tecnativa.com>
|
||||||
|
* David Vidal <david.vidal@tecnativa.com>
|
||||||
|
|
||||||
Maintainer
|
Maintainer
|
||||||
----------
|
----------
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Copyright 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com>
|
# Copyright 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com>
|
||||||
# Copyright 2017 Vicent Cubells - <vicent.cubells@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).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
|
|
||||||
{
|
{
|
||||||
"name": "Mail tracking for mass mailing",
|
"name": "Mail tracking for mass mailing",
|
||||||
"summary": "Improve mass mailing email tracking",
|
"summary": "Improve mass mailing email tracking",
|
||||||
"version": "9.0.1.0.0",
|
"version": "10.0.1.0.0",
|
||||||
"category": "Social Network",
|
"category": "Social Network",
|
||||||
"website": "http://www.tecnativa.com",
|
"website": "http://www.tecnativa.com",
|
||||||
"author": "Tecnativa, "
|
"author": "Tecnativa, "
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
try:
|
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:
|
except ImportError:
|
||||||
column_add_with_value = False
|
column_add_with_value = False
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# Copyright 2017 Vicent Cubells - <vicent.cubells@tecnativa.com>
|
# Copyright 2017 Vicent Cubells - <vicent.cubells@tecnativa.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 openerp import models, api
|
from odoo import models, api
|
||||||
|
|
||||||
|
|
||||||
class MailMail(models.Model):
|
class MailMail(models.Model):
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# Copyright 2017 Vicent Cubells - <vicent.cubells@tecnativa.com>
|
# Copyright 2017 Vicent Cubells - <vicent.cubells@tecnativa.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 openerp import models, fields
|
from odoo import models, fields
|
||||||
|
|
||||||
|
|
||||||
class MailMailStatistics(models.Model):
|
class MailMailStatistics(models.Model):
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# Copyright 2017 Vicent Cubells - <vicent.cubells@tecnativa.com>
|
# Copyright 2017 Vicent Cubells - <vicent.cubells@tecnativa.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 openerp import models, api, fields
|
from odoo import models, api, fields
|
||||||
|
|
||||||
|
|
||||||
class MailMassMailingContact(models.Model):
|
class MailMassMailingContact(models.Model):
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# Copyright 2017 Vicent Cubells - <vicent.cubells@tecnativa.com>
|
# Copyright 2017 Vicent Cubells - <vicent.cubells@tecnativa.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 openerp import models, fields, api
|
from odoo import models, fields, api
|
||||||
|
|
||||||
|
|
||||||
class MailTrackingEmail(models.Model):
|
class MailTrackingEmail(models.Model):
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# Copyright 2017 Vicent Cubells - <vicent.cubells@tecnativa.com>
|
# Copyright 2017 Vicent Cubells - <vicent.cubells@tecnativa.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 openerp import api, fields, models
|
from odoo import api, fields, models
|
||||||
|
|
||||||
|
|
||||||
class MailTrackingEvent(models.Model):
|
class MailTrackingEvent(models.Model):
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Copyright 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com>
|
# Copyright 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com>
|
||||||
# Copyright 2017 Vicent Cubells - <vicent.cubells@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).
|
# 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.tools import mute_logger
|
||||||
|
from odoo.tests.common import TransactionCase
|
||||||
|
|
||||||
mock_send_email = ('openerp.addons.base.ir.ir_mail_server.'
|
mock_send_email = ('odoo.addons.base.ir.ir_mail_server.'
|
||||||
'ir_mail_server.send_email')
|
'IrMailServer.send_email')
|
||||||
|
|
||||||
|
|
||||||
class TestMassMailing(TransactionCase):
|
class TestMassMailing(TransactionCase):
|
||||||
|
@ -33,9 +35,10 @@ class TestMassMailing(TransactionCase):
|
||||||
'reply_to_mode': 'email',
|
'reply_to_mode': 'email',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@mute_logger('odoo.addons.mail.models.mail_mail')
|
||||||
def test_smtp_error(self):
|
def test_smtp_error(self):
|
||||||
with mock.patch(mock_send_email) as mock_func:
|
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()
|
self.mailing.send_mail()
|
||||||
for stat in self.mailing.statistics_ids:
|
for stat in self.mailing.statistics_ids:
|
||||||
if stat.mail_mail_id:
|
if stat.mail_mail_id:
|
||||||
|
@ -46,7 +49,8 @@ class TestMassMailing(TransactionCase):
|
||||||
for track in tracking:
|
for track in tracking:
|
||||||
self.assertEqual('error', track.state)
|
self.assertEqual('error', track.state)
|
||||||
self.assertEqual('Warning', track.error_type)
|
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)
|
self.assertTrue(self.contact_a.email_bounced)
|
||||||
|
|
||||||
def test_tracking_email_link(self):
|
def test_tracking_email_link(self):
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!-- Copyright 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com>
|
<!-- Copyright 2016 Antonio Espinosa - <antonio.espinosa@tecnativa.com>
|
||||||
Copyright 2017 Vicent Cubells - <vicent.cubells@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). -->
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
|
||||||
<odoo>
|
<odoo>
|
||||||
|
|
||||||
|
@ -21,7 +22,7 @@
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<menuitem name="Mail tracking" id="mail_tracking_menu"
|
<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"
|
<menuitem name="Emails" id="mail_tracking_email_menu"
|
||||||
parent="mail_tracking_menu" sequence="1"
|
parent="mail_tracking_menu" sequence="1"
|
||||||
|
|
Loading…
Reference in New Issue