Browse Source

Merge pull request #205 from Tecnativa/10.0-forward199

[10.0][mail_tracking] IMPs and FIXes from v9
pull/208/head
Pedro M. Baeza 7 years ago
committed by GitHub
parent
commit
7d7a9e3feb
  1. 2
      mail_tracking/__manifest__.py
  2. 2
      mail_tracking/models/mail_message.py
  3. 6
      mail_tracking/models/mail_tracking_email.py
  4. 4
      mail_tracking/views/mail_tracking_event_view.xml

2
mail_tracking/__manifest__.py

@ -5,7 +5,7 @@
{ {
"name": "Email tracking", "name": "Email tracking",
"summary": "Email tracking system for all mails sent", "summary": "Email tracking system for all mails sent",
"version": "10.0.1.0.0",
"version": "10.0.1.0.1",
"category": "Social Network", "category": "Social Network",
"website": "http://www.tecnativa.com", "website": "http://www.tecnativa.com",
"author": "Tecnativa, " "author": "Tecnativa, "

2
mail_tracking/models/mail_message.py

@ -37,7 +37,7 @@ class MailMessage(models.Model):
partner_trackings = [] partner_trackings = []
partners_already = self.env['res.partner'] partners_already = self.env['res.partner']
partners = self.env['res.partner'] partners = self.env['res.partner']
trackings = self.env['mail.tracking.email'].search([
trackings = self.env['mail.tracking.email'].sudo().search([
('mail_message_id', '=', message.id), ('mail_message_id', '=', message.id),
]) ])
# Search all trackings for this message # Search all trackings for this message

6
mail_tracking/models/mail_tracking_email.py

@ -218,8 +218,12 @@ class MailTrackingEmail(models.Model):
self.ensure_one() self.ensure_one()
tracking_url = self._get_mail_tracking_img() tracking_url = self._get_mail_tracking_img()
if tracking_url: if tracking_url:
content = email.get('body', '')
content = re.sub(
r'<img[^>]*data-odoo-tracking-email=["\'][0-9]*["\'][^>]*>',
'', content)
body = tools.append_content_to_html( body = tools.append_content_to_html(
email.get('body', ''), tracking_url, plaintext=False,
content, tracking_url, plaintext=False,
container_tag='div') container_tag='div')
email['body'] = body email['body'] = body
return email return email

4
mail_tracking/views/mail_tracking_event_view.xml

@ -61,6 +61,7 @@
<field name="tracking_email_id"/> <field name="tracking_email_id"/>
<field name="recipient"/> <field name="recipient"/>
<field name="event_type"/> <field name="event_type"/>
<field name="error_details" invisible="not context.get('event_error_filter', False)"/>
<field name="date" invisible="1"/> <field name="date" invisible="1"/>
<field name="ip"/> <field name="ip"/>
<field name="url"/> <field name="url"/>
@ -91,7 +92,8 @@
<filter name="bounce" string="Bounce" <filter name="bounce" string="Bounce"
domain="[('event_type', 'in', ('hard_bounce', 'soft_bounce'))]"/> domain="[('event_type', 'in', ('hard_bounce', 'soft_bounce'))]"/>
<filter name="exception" string="Failed" <filter name="exception" string="Failed"
domain="[('event_type', 'in', ('reject', 'spam'))]"/>
domain="[('event_type', 'in', ('reject', 'spam'))]"
context="{'event_error_filter': True}"/>
<separator/> <separator/>
<group expand="0" string="Group By"> <group expand="0" string="Group By">
<filter string="Type" domain="[]" context="{'group_by': 'event_type'}"/> <filter string="Type" domain="[]" context="{'group_by': 'event_type'}"/>

Loading…
Cancel
Save