summaryrefslogtreecommitdiff
path: root/addons/mass_mailing/views
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-10-09 02:08:17 +0200
committerChristophe Simonis <chs@odoo.com>2019-10-09 02:08:17 +0200
commitd74b4518052066446e2a1975a91ce53c745ca75a (patch)
treec08180f88a512d15e37fbec628931f02b3825f65 /addons/mass_mailing/views
parentec162dd0cb5622ab6e56db1a63dab5f531a96f4a (diff)
parentf4105eb9c7010f8693e5d2fd20c0bd9d9cc2e483 (diff)
[MERGE] forward port branch 13.0 up to f4105eb9c70
Diffstat (limited to 'addons/mass_mailing/views')
-rw-r--r--addons/mass_mailing/views/mailing_mailing_views.xml202
-rw-r--r--addons/mass_mailing/views/utm_campaign_views.xml51
2 files changed, 115 insertions, 138 deletions
diff --git a/addons/mass_mailing/views/mailing_mailing_views.xml b/addons/mass_mailing/views/mailing_mailing_views.xml
index ad6e43ebf8f..7d26cce71be 100644
--- a/addons/mass_mailing/views/mailing_mailing_views.xml
+++ b/addons/mass_mailing/views/mailing_mailing_views.xml
@@ -29,7 +29,8 @@
<field name="priority">10</field>
<field name="arch" type="xml">
<tree string="Mailings">
- <field name="name"/>
+ <field name="state" invisible="1"/>
+ <field name="subject" attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
<field name="mailing_type" invisible="1"/>
<field name="sent"/>
<field name="delivered"/>
@@ -56,35 +57,37 @@
<field name="state" readonly="1" widget="statusbar"/>
</header>
- <div class="alert alert-info text-center" attrs="{'invisible': [('ignored', '=', 0)]}" role="alert">
- <button class="btn-link py-0"
- name="action_view_traces_ignored"
- type="object">
- <strong>
- <field name="ignored" class="oe_inline mr-2"/>
- <span name="ignored_text">emails have been ignored and will not be sent.</span>
- </strong>
- </button>
- </div>
- <div class="alert alert-info text-center" attrs="{'invisible': [('scheduled', '=', 0)]}" role="alert">
- <button class="btn-link py-0"
- name="action_view_traces_scheduled"
- type="object">
- <strong>
- <field name="scheduled" class="oe_inline mr-2"/>
- <span name="scheduled_text">emails are in queue and will be sent soon.</span>
- </strong>
- </button>
- </div>
- <div class="alert alert-info text-center" attrs="{'invisible': ['|', ('state', '!=', 'done'), ('failed', '=', 0)]}" role="alert">
- <button class="btn-link py-0"
- name="action_view_traces_failed"
- type="object">
- <strong>
- <field name="failed" class="oe_inline mr-2"/>
- <span name="failed_text">emails could not be sent.</span>
- </strong>
- </button>
+ <div class="alert alert-info text-center" role="alert" attrs="{'invisible': ['&amp;','&amp;',('ignored', '=', 0),('scheduled', '=', 0),('failed', '=', 0)]}">
+ <div attrs="{'invisible': [('ignored', '=', 0)]}">
+ <button class="btn-link py-0"
+ name="action_view_traces_ignored"
+ type="object">
+ <strong>
+ <field name="ignored" class="oe_inline mr-2"/>
+ <span name="ignored_text">emails have been ignored and will not be sent.</span>
+ </strong>
+ </button>
+ </div>
+ <div attrs="{'invisible': [('scheduled', '=', 0)]}">
+ <button class="btn-link py-0"
+ name="action_view_traces_scheduled"
+ type="object">
+ <strong>
+ <field name="scheduled" class="oe_inline mr-2"/>
+ <span name="scheduled_text">emails are in queue and will be sent soon.</span>
+ </strong>
+ </button>
+ </div>
+ <div attrs="{'invisible': ['|', ('state', '!=', 'done'), ('failed', '=', 0)]}">
+ <button class="btn-link py-0"
+ name="action_view_traces_failed"
+ type="object">
+ <strong>
+ <field name="failed" class="oe_inline mr-2"/>
+ <span name="failed_text">emails could not be sent.</span>
+ </strong>
+ </button>
+ </div>
</div>
<div class="alert alert-info text-center" attrs="{'invisible': [('state', '!=', 'in_queue')]}" role="alert">
<strong>
@@ -134,15 +137,14 @@
<widget name="web_ribbon" text="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
<group>
<field name="active" invisible="1"/>
- <field name="name" required="1" string="Name"/>
<field name="mailing_type" widget="radio" options="{'horizontal': true}" invisible="1"
attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
<field name="subject" string="Subject" attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
<label for="mailing_model_id" string="Recipients"/>
- <div>
+ <div name="mailing_model_id_container">
<div class="row">
<div class="col-xs-12 col-md-3" >
- <field name="mailing_model_id" widget="selection"
+ <field name="mailing_model_id" widget="selection" required="True"
attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
</div>
<div attrs="{'invisible': [('mailing_model_name', '!=', 'mailing.list')]}" class="col-xs-12 col-md-9 pt-1">
@@ -158,35 +160,28 @@
<field name="mailing_model_name" invisible="1"/>
<field name="mailing_model_real" invisible="1"/>
- <field name="mailing_domain" widget="domain" options="{'model': 'mailing_model_real'}"
- attrs="{
- 'invisible': [('mailing_model_name', '=', 'mailing.list')],
- 'readonly': [('state', 'in', ('sending', 'done'))]
- }">
- </field>
+ <div attrs="{'invisible': [('mailing_model_name', '=', 'mailing.list')]}">
+ <field name="mailing_domain" widget="domain" options="{'model': 'mailing_model_real'}"
+ attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
+ </div>
</div>
</group>
<notebook>
<page string="Mail Body" name="mail_body">
- <div attrs="{'invisible': [('state', 'in', ('sending', 'done'))]}">
- <field name="body_html" class="oe_read_only" widget="html"
- options="{'cssReadonly': 'mass_mailing.iframe_css_assets_readonly'}"/>
- <field name="body_arch" class="o_mail_body oe_edit_only" widget="mass_mailing_html"
- options="{
- 'snippets': 'mass_mailing.email_designer_snippets',
- 'cssEdit': 'mass_mailing.iframe_css_assets_edit',
- 'inline-field': 'body_html'
- }"/>
- </div>
- <div attrs="{'invisible': [('state', 'not in', ('sending', 'done'))]}">
- <field name="body_html" attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
- </div>
+ <field name="body_html" class="oe_read_only" widget="html"
+ options="{'cssReadonly': 'mass_mailing.iframe_css_assets_readonly'}"/>
+ <field name="body_arch" class="o_mail_body oe_edit_only" widget="mass_mailing_html"
+ options="{
+ 'snippets': 'mass_mailing.email_designer_snippets',
+ 'cssEdit': 'mass_mailing.iframe_css_assets_edit',
+ 'inline-field': 'body_html'
+ }" attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
</page>
<page string="Settings">
<group>
<group>
+ <field name="name" required="False" groups="base.group_no_one" string="Name"/>
<field name="user_id"/>
- <field name="unique_ab_testing" groups="base.group_no_one" attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
<field name="email_from" attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
<label for="reply_to"/>
<div name="reply_to_details">
@@ -215,7 +210,8 @@
<field name="campaign_id"
string="Mailing Campaign"
groups="mass_mailing.group_mass_mailing_campaign"
- attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
+ attrs="{'readonly': [('state', 'in', ('sending', 'done'))],
+ 'required': [('unique_ab_testing', '=', True)]}"/>
<field name="source_id"
string="Source"
readonly="1"
@@ -227,6 +223,9 @@
required="True"
groups="base.group_no_one"
attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
+ <field name="unique_ab_testing"
+ groups="mass_mailing.group_mass_mailing_campaign"
+ attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
<label for="contact_ab_pc" groups="mass_mailing.group_mass_mailing_campaign"/>
<div groups="mass_mailing.group_mass_mailing_campaign">
<field name="contact_ab_pc"
@@ -260,6 +259,7 @@
<field name='failed'/>
<field name='total'/>
<field name='mailing_model_id'/>
+ <field name='mailing_model_name'/>
<field name='sent_date'/>
<field name='active'/>
<templates>
@@ -283,8 +283,20 @@
<div class="oe_kanban_content">
<div class="o_kanban_record_top">
<div class="o_kanban_record_headings">
- <h3 class="mt4 mb4">
- <field name="name"/>
+ <div class="row" attrs="{'invisible': [('sent_date', '=', False)]}">
+ <h3 class="my-1 col-8 o_text_overflow">
+ <field name="subject"/>
+ </h3>
+ <div class="progress border col-3 px-0 mt-2" style="background-color: inherit; height:12px;">
+ <div class="progress-bar" role="progressbar"
+ aria-valuemin="0"
+ t-att-aria-valuenow="record.delivered.raw_value"
+ t-att-aria-valuemax="record.expected.raw_value"
+ t-attf-style="width: #{record.delivered.raw_value * 100 / record.expected.raw_value}%"/>
+ </div>
+ </div>
+ <h3 class="my-1 o_text_overflow" attrs="{'invisible': [('sent_date', '!=', False)]}">
+ <field name="subject"/>
</h3>
<field name="mailing_type" invisible="1"/>
<div class="o_kanban_record_subtitle" attrs="{'invisible': [('sent_date', '=', False)]}">
@@ -295,45 +307,36 @@
</div>
</div>
<div class="o_kanban_record_body" t-if="!selection_mode" attrs="{'invisible': [('sent_date', '=', False)]}">
- <t t-if="record.sent_date">
- <div class="row" name="stat_opened">
- <div class="col-8">
- Opened
- </div>
- <div class="col-4 text-right">
- <field name="opened_ratio"/> %
- </div>
- </div>
- <div class="row" name="stat_replied">
- <div class="col-8">
- Replied
- </div>
- <div class="col-4 text-right">
- <field name="replied_ratio"/> %
- </div>
+ <div>
+ <b><field name="delivered"/> / <field name="expected"/></b> Delivered to
+ <field name='mailing_model_id' attrs="{'invisible': [('mailing_model_name','=','mailing.list')]}"/>
+ <span attrs="{'invisible': [('mailing_model_name','!=','mailing.list')]}">Mailing Contact</span>
+ </div>
+ <div class="d-flex justify-content-between">
+ <div name="stat_opened">
+ <b><field name="opened_ratio" />%</b> Opened
</div>
- <div class="row" name="stat_clicks">
- <div class="col-8">
- Clicks
- </div>
- <div class="col-4 text-right">
- <field name="clicks_ratio"/> %
- </div>
+ <div name="stat_replied">
+ <b><field name="replied_ratio" />%</b> Replied
</div>
- <div class='mt-1' name="stat_delivered">
- <field name="delivered" widget="progressbar" title="Delivered" options="{'current_value': 'delivered', 'max_value': 'expected', 'editable': false}"/>
+ <div name="stat_clicks">
+ <b><field name="clicks_ratio" />%</b> Clicks
</div>
- </t>
+ </div>
</div>
</div>
- <div>
- <span class="fa fa-clock-o text-muted mr-2" attrs="{'invisible': [('sent_date', '=', False)]}"/><field name="sent_date"/>
+ <div name="div_responsible_avatar">
+ <span attrs="{'invisible': [('sent_date', '=', False)]}">
+ <span class="fa fa-clock-o text-muted mr-2"/>
+ <field name="sent_date" widget="date"/>
+ </span>
+ <span attrs="{'invisible': [('sent_date', '!=', False)]}" class="oe_clear text-muted">
+ <field name='total'/>
+ <field name='mailing_model_id' attrs="{'invisible': [('mailing_model_name','=','mailing.list')]}"/>
+ <span attrs="{'invisible': [('mailing_model_name','!=','mailing.list')]}">Mailing Contact</span>
+ </span>
<img t-att-src="kanban_image('res.users', 'image_128', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" class="o_image_24_cover oe_kanban_avatar float-right"/>
</div>
- <div name="div_total_model" class="oe_clear text-muted" style="display: inline;">
- <field name='total'/>
- <field name='mailing_model_id'/>
- </div>
</div>
</t>
</templates>
@@ -382,6 +385,7 @@
'default_user_id': uid,
}
</field>
+ <field name="domain">[('mailing_type', '=', 'mail')]</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new mailing
@@ -413,28 +417,6 @@
</field>
</record>
- <record id="action_create_ab_mass_mailings_from_campaign" model="ir.actions.act_window">
- <field name="name">Mailings</field>
- <field name="res_model">mailing.mailing</field>
- <field name="view_mode">form,kanban,tree</field>
- <field name="context">{
- 'search_default_assigned_to_me': 1,
- 'search_default_campaign_id': [active_id],
- 'default_campaign_id': active_id,
- 'default_contact_ab_pc': 10,
- 'default_user_id': uid,
- }
- </field>
- <field name="help" type="html">
- <p class="o_view_nocontent_smiling_face">
- Create a new mailing
- </p><p>
- You don't need to import your mailing lists, you can easily
- send emails<br/> to any contact saved in other Odoo apps.
- </p>
- </field>
- </record>
-
<menuitem name="Mailings" id="mass_mailing_menu"
parent="mass_mailing_menu_root"
sequence="1"
diff --git a/addons/mass_mailing/views/utm_campaign_views.xml b/addons/mass_mailing/views/utm_campaign_views.xml
index 82f08f4ec4b..940120e14bd 100644
--- a/addons/mass_mailing/views/utm_campaign_views.xml
+++ b/addons/mass_mailing/views/utm_campaign_views.xml
@@ -5,35 +5,30 @@
<field name="model">utm.campaign</field>
<field name="inherit_id" ref="utm.utm_campaign_view_form"/>
<field name="arch" type="xml">
- <xpath expr="//sheet" position="before">
- <header style="min-height:31px;">
- <button name="%(action_create_mass_mailings_from_campaign)d" type="action" class="oe_highlight" string="Create a mailing"/>
- <button name="%(action_create_ab_mass_mailings_from_campaign)d" type="action" class="btn-secondary" string="Create an A/B Testing Mailing"/>
- <span><field name="stage_id" widget="statusbar" options="{'clickable': '1'}"/></span>
- </header>
+ <xpath expr="//header" position="inside">
+ <button name="%(action_create_mass_mailings_from_campaign)d" type="action" class="oe_highlight" groups="mass_mailing.group_mass_mailing_campaign" string="Send new Mailing"/>
</xpath>
<xpath expr="//div[hasclass('oe_button_box')]" position="inside">
<button name="%(action_view_mass_mailings_from_campaign)d"
- type="action" class="oe_stat_button order-11" icon="fa-envelope-o">
- <field name="mailing_items" widget="statinfo" string="Mailings"/>
+ type="action" class="oe_stat_button order-9" icon="fa-envelope-o"
+ attrs="{'invisible': [('mailing_mail_count', '=', 0)]}" groups="mass_mailing.group_mass_mailing_campaign">
+ <field name="mailing_mail_count" widget="statinfo" string="Mailings"/>
</button>
</xpath>
<xpath expr="//notebook" position="inside">
- <page string="Mailings" attrs="{}">
- <group groups="base.group_no_one">
- <field name="mailing_ids" readonly="1" nolabel="1">
- <tree>
- <field name="name"/>
- <field name="sent_date"/>
- <field name="state"/>
- <field name="delivered"/>
- <field name="opened"/>
- <field name="replied"/>
- <field name="bounced"/>
- <button name="action_duplicate" type="object" string="Duplicate"/>
- </tree>
- </field>
- </group>
+ <page string="Mailings" attrs="{'invisible': [('mailing_mail_count', '=', 0)]}">
+ <field name="mailing_mail_ids" readonly="1" nolabel="1">
+ <tree>
+ <field name="name"/>
+ <field name="sent_date"/>
+ <field name="state"/>
+ <field name="delivered"/>
+ <field name="opened"/>
+ <field name="replied"/>
+ <field name="bounced"/>
+ <button name="action_duplicate" type="object" string="Duplicate"/>
+ </tree>
+ </field>
<div class="o_utm_campaign_mass_mailing_substats d-flex justify-content-end align-items-center">
<div class="d-flex justify-content-end align-items-center flex-column">
<label for="received_ratio" string="Delivered" class="m-0"/>
@@ -83,19 +78,19 @@
<field name="inherit_id" ref="utm.utm_campaign_view_kanban"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='user_id']" position="after">
- <field name="mailing_ids"/>
+ <field name="mailing_mail_ids"/>
</xpath>
- <xpath expr="//div[hasclass('o_kanban_record_headings')]">
+ <xpath expr="//ul[@id='o_utm_actions']">
<a name="%(action_view_mass_mailings_from_campaign)d" type="action"
- class="oe_mailings o_kanban_record_subtitle d-inline-block">
- <t t-raw="record.mailing_ids.raw_value.length"/> Mailings
+ t-attf-class="oe_mailings #{record.mailing_mail_ids.raw_value.length === 0 ? 'text-muted' : ''}">
+ <t t-raw="record.mailing_mail_ids.raw_value.length"/> Mailings
</a>
</xpath>
</field>
</record>
<record id="action_view_utm_campaigns" model="ir.actions.act_window">
- <field name="name">UTM Campaigns</field>
+ <field name="name">Campaigns</field>
<field name="res_model">utm.campaign</field>
<field name="view_mode">kanban,tree,form</field>
<field name="help" type="html">