[FIX] mail_tracking_mailgun: Message error on bounce
This commit is contained in:
parent
ed69644616
commit
07e9a8ac54
@ -7,7 +7,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Mail tracking for Mailgun",
|
"name": "Mail tracking for Mailgun",
|
||||||
"summary": "Mail tracking and Mailgun webhooks integration",
|
"summary": "Mail tracking and Mailgun webhooks integration",
|
||||||
"version": "10.0.1.1.1",
|
"version": "10.0.1.1.2",
|
||||||
"category": "Social Network",
|
"category": "Social Network",
|
||||||
"website": "https://odoo-community.org/",
|
"website": "https://odoo-community.org/",
|
||||||
"author": "Tecnativa, "
|
"author": "Tecnativa, "
|
||||||
|
@ -30,8 +30,7 @@ class ResPartner(models.Model):
|
|||||||
body = _('Email has been bounced: %s\n'
|
body = _('Email has been bounced: %s\n'
|
||||||
'Reason: %s\n'
|
'Reason: %s\n'
|
||||||
'Event: %s') % (partner.email, reason,
|
'Event: %s') % (partner.email, reason,
|
||||||
event and event.get('Message-Id',
|
event and event.id or _('unknown'))
|
||||||
_('unknown')))
|
|
||||||
partner.message_post(body=body)
|
partner.message_post(body=body)
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
|
@ -389,10 +389,10 @@ class TestMailgun(TransactionCase):
|
|||||||
|
|
||||||
def test_email_bounced_set(self):
|
def test_email_bounced_set(self):
|
||||||
message_number = len(self.partner.message_ids) + 1
|
message_number = len(self.partner.message_ids) + 1
|
||||||
self.partner._email_bounced_set('test_error', self.event)
|
self.partner._email_bounced_set('test_error', False)
|
||||||
self.assertEqual(len(self.partner.message_ids), message_number)
|
self.assertEqual(len(self.partner.message_ids), message_number)
|
||||||
self.partner.email = ""
|
self.partner.email = ""
|
||||||
self.partner._email_bounced_set('test_error', self.event)
|
self.partner._email_bounced_set('test_error', False)
|
||||||
self.assertEqual(len(self.partner.message_ids), message_number)
|
self.assertEqual(len(self.partner.message_ids), message_number)
|
||||||
|
|
||||||
@mock.patch(_packagepath + '.models.mail_tracking_email.requests')
|
@mock.patch(_packagepath + '.models.mail_tracking_email.requests')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user