Skip to content
Permalink
Browse files

[IMP] link_tracker, mass_mailing: improve link tracker, click and mai…

…l statistic views

Purpose is to have more information available in list and form views. As
trying to access those models is a technical move let us give users all
necessary information to understand / debug a bit what happens.

Concerning links we add necessary view type and fields to ease understanding
of tracking data. Notably in mass mailing mailing related information is added
for clicks.

This commit is linked to task ID 1924711 and PR #30059.
  • Loading branch information...
tde-banana-odoo committed Jan 9, 2019
1 parent 0a09a4d commit 8fa4a6ae2e914207a4e513b05f0f42079ce02aa6
@@ -9,6 +9,8 @@
<search string="Links">
<field name="url" string="Title and URL" filter_domain="['|', ('title', 'ilike', self), ('url', 'ilike', self)]"/>
<field name="title"/>
<group expand="0" string="Group By">
</group>
</search>
</field>
</record>
@@ -83,6 +85,21 @@
</record>

<!-- LINK.TRACKER.CLICK -->
<record id="link_tracker_click_view_search" model="ir.ui.view">
<field name="name">link.tracker.click.view.search</field>
<field name="model">link.tracker.click</field>
<field name="arch" type="xml">
<search string="Clicks">
<field name="link_id"/>
<field name="country_id"/>
<group expand="0" string="Group By">
<filter string="Link" name="groupby_link_id" domain="[]" context="{'group_by': 'link_id'}"/>
<filter string="Country" name="groupby_country_id" context="{'group_by': 'country_id'}"/>
</group>
</search>
</field>
</record>

<record id="link_tracker_click_view_form" model="ir.ui.view">
<field name="name">link.tracker.click.view.form</field>
<field name="model">link.tracker.click</field>
@@ -115,7 +132,7 @@
<field name="name">link.tracker.click.view.graph</field>
<field name="model">link.tracker.click</field>
<field name="arch" type="xml">
<graph string="Link Clicks">
<graph string="Link Clicks" type="pie">
<field name="link_id"/>
<field name="ip"/>
<field name="country_id"/>
@@ -126,7 +143,7 @@
<record id="link_tracker_click_action_statistics" model="ir.actions.act_window">
<field name="name">Click Statistics</field>
<field name="res_model">link.tracker.click</field>
<field name="view_mode">graph</field>
<field name="view_mode">graph,tree,form</field>
<field name="domain">[]</field>
</record>

@@ -10,6 +10,10 @@
<field name="mass_mailing_id"/>
<field name="mass_mailing_campaign_id"/>
</xpath>
<xpath expr="//group" position="inside">
<filter string="Mass Mailing" name="groupby_mass_mailing_id" context="{'group_by': 'mass_mailing_id'}"/>
<filter string="Mailing Campaign" name="groupby_mass_mailing_campaign_id" domain="[]" context="{'group_by': 'mass_mailing_campaign_id'}"/>
</xpath>
</field>
</record>

@@ -53,6 +57,60 @@
<field name="context">{'id="link_tracker_action_mass_mailing"': active_id}</field>
</record>

<!-- LINK.TRACKER.CLICK VIEWS -->
<record id="link_tracker_click_view_search" model="ir.ui.view">
<field name="name">link.tracker.click.view.search.inherit.mass_mailing</field>
<field name="model">link.tracker.click</field>
<field name="inherit_id" ref="link_tracker.link_tracker_click_view_search"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='country_id']" position="after">
<field name="mass_mailing_campaign_id"/>
<field name="mass_mailing_id"/>
</xpath>
<xpath expr="//filter[@name='groupby_country_id']" position="after">
<filter string="Mass Mailing" name="groupby_mass_mailing_id" context="{'group_by': 'mass_mailing_id'}"/>
<filter string="Mailing Campaign" name="groupby_mass_mailing_campaign_id" domain="[]" context="{'group_by': 'mass_mailing_campaign_id'}"/>
</xpath>
</field>
</record>

<record id="link_tracker_click_view_form" model="ir.ui.view">
<field name="name">link.tracker.click.view.form.inherit.mass_mailing</field>
<field name="model">link.tracker.click</field>
<field name="inherit_id" ref="link_tracker.link_tracker_click_view_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='country_id']" position="after">
<field name="mass_mailing_campaign_id"/>
<field name="mass_mailing_id"/>
<field name="mail_stat_id"/>
</xpath>
</field>
</record>

<record id="link_tracker_click_view_tree" model="ir.ui.view">
<field name="name">link.tracker.click.view.tree.inherit.mass_mailing</field>
<field name="model">link.tracker.click</field>
<field name="inherit_id" ref="link_tracker.link_tracker_click_view_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='link_id']" position="after">
<field name="mass_mailing_campaign_id"/>
<field name="mass_mailing_id"/>
</xpath>
</field>
</record>

<record id="link_tracker_click_view_graph" model="ir.ui.view">
<field name="name">link.tracker.click.view.graph.inherit.mass_mailing</field>
<field name="model">link.tracker.click</field>
<field name="inherit_id" ref="link_tracker.link_tracker_click_view_graph"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='country_id']" position="after">
<field name="mass_mailing_campaign_id"/>
<field name="mass_mailing_id"/>
</xpath>
</field>
</record>

<!-- MENU TO HANLDE LINK DATA IN MM -->
<menuitem id="link_tracker_menu_mass_mailing"
name="Link Tracker"
@@ -36,13 +36,15 @@
<field name="arch" type="xml">
<tree string="Mail Statistics" create="0">
<field name="email"/>
<field name="state"/>
<field name="message_id"/>
<field name="sent"/>
<field name="exception"/>
<field name="opened"/>
<field name="clicked"/>
<field name="replied"/>
<field name="bounced"/>
<field name="ignored"/>
</tree>
</field>
</record>
@@ -52,31 +54,31 @@
<field name="model">mail.mail.statistics</field>
<field name="arch" type="xml">
<form string="Mail Statistics" create="0">
<div class="oe_form_box_info bg-info oe_text_center alert-info" attrs="{'invisible': [('exception', '=', False)]}" role="alert">
<p><strong>This email could not be sent.</strong></p>
</div>
<header>
<field name="state" widget="statusbar"/>
</header>
<sheet>
<div class="oe_form_box_info bg-info oe_text_center alert-info" attrs="{'invisible': [('exception', '=', False)]}" role="alert">
<p><strong>This email could not be sent.</strong></p>
</div>
<group>
<group>
<field name="email"/>
<field name="email" string="Email"/>
<field name="mass_mailing_id"/>
<field name="mass_mailing_campaign_id" groups="mass_mailing.group_mass_mailing_campaign"/>
<field name="mail_mail_id_int" groups="base.group_no_one"/>
<field name="message_id" groups="base.group_no_one"/>
<field name="model" groups="base.group_no_one"/>
<field name="res_id" groups="base.group_no_one"/>
</group>

<group>
<field name="exception" attrs="{'invisible': [('exception', '=', False)]}"/>
<field name="exception"/>
<field name="sent"/>
<field name="opened"/>
<field name="clicked"/>
<field name="replied"/>
<field name="bounced"/>
</group>

<group groups="base.group_no_one">
<field name="mail_mail_id_int"/>
<field name="message_id"/>
<field name="model"/>
<field name="res_id"/>
<field name="ignored"/>
</group>
</group>
</sheet>

0 comments on commit 8fa4a6a

Please sign in to comment.
You can’t perform that action at this time.