[IMP] mass_mailing : improve interface, UI and usability

In order to improve and clarify the mass-mailing (Email Marketing) module
several changes have been made

1 - Clarify the name of the application:
2 - Prevent the “Quick Add/Create” feature in the mailing kanban view
3 - Label and wording clarification in mailing_mailing form view :
4 - Clarify button names "Send now" ("put_in_queue")
5 - Mailing Form view layout
6 - Clarify the required field
7 - Clarify the readonly field
8 - Wording clarification if scheduling mail in the future
9 - Add a Placeholders tools page in the form view:
10 - Clarify the Campaigns view
11 - Clarify the Action Helpers

TASK-ID : 2046078

closes odoo/odoo#36124

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
laa
2019-09-06 07:47:13 +00:00
committed by Thibault Delavallée
parent 2ab1259433
commit 2b6ebb3df7
12 changed files with 120 additions and 64 deletions
@@ -84,7 +84,9 @@
<field name="view_id" ref="link_tracker_view_tree"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new link tracker
Create a link tracker
</p><p>
Trackers are used to collect count stat about click on links and generate short URLs.
</p>
</field>
</record>
@@ -160,7 +162,9 @@
<field name="view_id" ref="link_tracker.link_tracker_view_tree"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new link tracker
Create a link tracker
</p><p>
Trackers are used to collect count stat about click on links and generate short URLs.
</p>
</field>
<field name="context">{'search_default_campaign_id': active_id}</field>
+1 -1
View File
@@ -2,7 +2,7 @@ Odoo Mass Mailing
-----------------
Easily send mass mailing to your leads, opportunities or customers
with Odoo <a href="https://www.odoo.com/page/mailing#">Mass Mailing</a>. Track
with Odoo <a href="https://www.odoo.com/page/mailing#">Email Marketing</a>. Track
marketing campaigns performance to improve conversion rates. Design
professional emails and reuse templates in a few clicks.
@@ -3,7 +3,7 @@
<data noupdate="1">
<!-- Cron that process the mass mailing queue -->
<record id="ir_cron_mass_mailing_queue" model="ir.cron">
<field name="name">Mass Mailing: Process queue</field>
<field name="name">Email Marketing: Process queue</field>
<field name="model_id" ref="model_mailing_mailing"/>
<field name="state">code</field>
<field name="code">model._process_mass_mailing_queue()</field>
+6 -5
View File
@@ -39,6 +39,7 @@ class MassMailing(models.Model):
A mass mailing is an occurence of sending emails. """
_name = 'mailing.mailing'
_description = 'Mass Mailing'
_inherit = [ 'mail.thread', 'mail.activity.mixin']
# number of periods for tracking mail_mail statistics
_period_number = 6
_order = 'sent_date DESC'
@@ -64,12 +65,12 @@ class MassMailing(models.Model):
res['reply_to_mode'] = 'thread'
return res
active = fields.Boolean(default=True)
active = fields.Boolean(default=True, tracking=True)
subject = fields.Char('Subject', help='Subject of emails to send', required=True, translate=True)
email_from = fields.Char(string='From', required=True,
email_from = fields.Char(string='Send From', required=True,
default=lambda self: self.env['mail.message']._get_default_from())
sent_date = fields.Datetime(string='Sent Date', copy=False)
schedule_date = fields.Datetime(string='Schedule in the Future')
schedule_date = fields.Datetime(string='Scheduled for', tracking=True)
# don't translate 'body_arch', the translations are only on 'body_html'
body_arch = fields.Html(string='Body', translate=False)
body_html = fields.Html(string='Body converted to be send by mail', sanitize_attributes=False)
@@ -82,9 +83,9 @@ class MassMailing(models.Model):
medium_id = fields.Many2one('utm.medium', string='Medium', help="Delivery method: Email")
clicks_ratio = fields.Integer(compute="_compute_clicks_ratio", string="Number of Clicks")
state = fields.Selection([('draft', 'Draft'), ('in_queue', 'In Queue'), ('sending', 'Sending'), ('done', 'Sent')],
string='Status', required=True, copy=False, default='draft', group_expand='_group_expand_states')
string='Status', required=True, tracking=True, copy=False, default='draft', group_expand='_group_expand_states')
color = fields.Integer(string='Color Index')
user_id = fields.Many2one('res.users', string='Responsible', default=lambda self: self.env.user)
user_id = fields.Many2one('res.users', string='Responsible', tracking=True, default=lambda self: self.env.user)
# mailing options
mailing_type = fields.Selection([('mail', 'Email')], string="Mailing Type", default="mail", required=True)
reply_to_mode = fields.Selection(
@@ -34,7 +34,9 @@
<field name="view_id" ref="link_tracker.link_tracker_view_tree"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new link tracker
Create a link tracker
</p><p>
Trackers are used to collect count stat about click on links and generate short URLs.
</p>
</field>
<field name="context">{'search_default_mass_mailing_id': active_id}</field>
@@ -47,7 +49,9 @@
<field name="view_id" ref="link_tracker.link_tracker_view_tree"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new link tracker
Create a link tracker
</p><p>
Trackers are used to collect count stat about click on links and generate short URLs.
</p>
</field>
<field name="context">{'id="link_tracker_action_mass_mailing"': active_id}</field>
@@ -223,9 +223,9 @@
<field name="context">{'search_default_filter_not_email_bl': 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a contact in your address book
Create a mailing contact
</p><p>
Odoo helps you to easily track all activities related to a customer.
Mailing contacts allow you to separate your marketing audience from your business contact directory.
</p>
</field>
</record>
@@ -47,7 +47,7 @@
<field name="arch" type="xml">
<form string="Mailing">
<header style="min-height:31px;">
<button name="action_put_in_queue" type="object" attrs="{'invisible': [('state', 'in', ('in_queue', 'done'))]}" class="oe_highlight" string="Send Now"
<button name="action_put_in_queue" type="object" attrs="{'invisible': [('state', 'in', ('in_queue', 'done'))]}" class="oe_highlight" string="Send"
confirm="This will send the email to all recipients. Do you still want to proceed ?"/>
<button name="action_schedule" type="object" attrs="{'invisible': [('state', 'in', ('in_queue', 'done'))]}" class="btn-secondary" string="Schedule"/>
<button name="action_test" type="object" class="btn-secondary" string="Test"/>
@@ -141,80 +141,114 @@
<group>
<field name="active" invisible="1"/>
<field name="name" required="1" string="Mailing Name"/>
<field name="mailing_type" widget="radio" options="{'horizontal': true}" invisible="1"/>
<field name="subject" string="Subject"/>
<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>
<field name="mailing_model_id" widget="selection" required="1"/>
<div class="row">
<div class="col-xs-12 col-md-3" >
<field name="mailing_model_id" widget="selection"
attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
</div>
<div attrs="{'invisible': [('mailing_model_name', '!=', 'mailing.list')]}" class="col-xs-12 col-md-9 pt-1">
<label for="contact_list_ids" string="Select mailing lists:" class="oe_edit_only"/>
<field name="contact_list_ids" widget="many2many_tags"
placeholder="Select mailing lists..." class="oe_inline"
attrs="{
'required':[('mailing_model_name','=','mailing.list')],
'readonly': [('state', 'in', ('sending', 'done'))]
}"/>
</div>
</div>
<field name="mailing_model_name" invisible="1"/>
<field name="mailing_model_real" invisible="1"/>
<field name="mailing_domain" widget="domain"
attrs="{'invisible': [('mailing_model_name', '=', 'mailing.list')]}"
options="{'model': 'mailing_model_real'}">
</field>
<div attrs="{'invisible': [('mailing_model_name', '!=', 'mailing.list')]}">
<label for="contact_list_ids" string="Select mailing lists:" class="oe_edit_only"/>
<field name="contact_list_ids" widget="many2many_tags"
placeholder="Select mailing lists..." class="oe_inline"/>
</div>
<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>
</group>
<notebook>
<page string="Mail Body" name="mail_body">
<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 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>
</page>
<page string="Options">
<page string="Settings">
<group>
<group string="Mailing">
<group>
<field name="user_id"/>
<field name="unique_ab_testing" groups="base.group_no_one"/>
<field name="email_from"/>
<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">
<field name="reply_to_mode" widget="radio"
attrs="{'invisible': [('mailing_model_name', 'in', ['mailing.contact', 'res.partner', 'mailing.list'])]}"/>
attrs="{
'invisible': [('mailing_model_name', 'in', ['mailing.contact', 'res.partner', 'mailing.list'])],
'readonly': [('state', 'in', ('sending', 'done'))]
}"/>
<field name="reply_to"
attrs="{'required': [('reply_to_mode', '=', 'email')], 'invisible': [('reply_to_mode', '=', 'thread')]}"/>
attrs="{
'required': [('reply_to_mode', '=', 'email')],
'invisible': [('reply_to_mode', '=', 'thread')],
'readonly': [('state', 'in', ('sending', 'done'))]
}"/>
</div>
<label for="attachment_ids"/>
<div name="attachment_ids_details">
<field name="attachment_ids" widget="many2many_binary" string="Attach a file" class="oe_inline"/>
<field name="attachment_ids" widget="many2many_binary" string="Attach a file" class="oe_inline"
attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
</div>
<field name="mail_server_id" groups="base.group_no_one" options="{'no_create': True, 'no_open': True}"/>
<field name="schedule_date" groups='base.group_no_one'/>
<field name="keep_archives" groups="base.group_no_one"/>
<field name="create_date" readonly="1" attrs="{'invisible': [('create_date', '=', False)]}"/>
<field name="sent_date" readonly="1" attrs="{'invisible': [('sent_date', '=', False)]}"/>
<field name="mail_server_id" groups="base.group_no_one" options="{'no_create': True, 'no_open': True}"
attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
<field name="keep_archives" groups="base.group_no_one" attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
</group>
<group string="Marketing" groups="base.group_no_one,mass_mailing.group_mass_mailing_campaign">
<field name="campaign_id"
string="Mailing Campaign"
groups="mass_mailing.group_mass_mailing_campaign"/>
groups="mass_mailing.group_mass_mailing_campaign"
attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
<field name="source_id"
string="Source"
readonly="1"
required="False"
groups="base.group_no_one"/>
groups="base.group_no_one"
attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/>
<field name="medium_id"
string="Medium"
required="True"
groups="base.group_no_one"/>
groups="base.group_no_one"
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" class="oe_inline"/> %
<field name="contact_ab_pc"
class="oe_inline"
attrs="{'readonly': [('state', 'in', ('sending', 'done'))]}"/> %
</div>
</group>
</group>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>
<field name="message_ids" widget="mail_thread"/>
<field name="activity_ids" widget="mail_activity"/>
</div>
</form>
</field>
</record>
@@ -223,7 +257,7 @@
<field name="name">mailing.mailing.kanban</field>
<field name="model">mailing.mailing</field>
<field name="arch" type="xml">
<kanban default_group_by="state">
<kanban default_group_by="state" quick_create="false">
<field name='state' readonly="1"/>
<field name='email_from' readonly="1"/>
<field name='color'/>
@@ -7,8 +7,8 @@
<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="Send new Mailing"/>
<button name="%(action_create_ab_mass_mailings_from_campaign)d" type="action" class="oe_highlight" string="Send new A/B Testing Mailing"/>
<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>
@@ -100,9 +100,9 @@
<field name="view_mode">kanban,tree,form</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new UTM campaign
Create a mailing campaign
</p><p>
Create a campaign to structure mailing and get analysis from email status.
Campaigns are the perfect tool to track results across multiple mailings.
</p>
</field>
<field name="domain">[('is_website', '=', False)]</field>
@@ -117,7 +117,7 @@
parent="mass_mailing_configuration" sequence="1"
groups="mass_mailing.group_mass_mailing_campaign"
action="utm.action_view_utm_stage"/>
<menuitem id="mass_mailing_tag_menu"
parent="mass_mailing_configuration"
action="utm.action_view_utm_tag"
@@ -9,7 +9,7 @@ class MailingMailingScheduleDate(models.TransientModel):
_name = 'mailing.mailing.schedule.date'
_description = 'Mass Mailing Scheduling'
schedule_date = fields.Datetime(string='Schedule in the Future')
schedule_date = fields.Datetime(string='Scheduled for')
mass_mailing_id = fields.Many2one('mailing.mailing', required=True, ondelete='cascade')
@api.constrains('schedule_date')
@@ -7,7 +7,7 @@
<form string="Take Future Schedule Date">
<group>
<group>
<field name="schedule_date" required="1"/>
<field name="schedule_date" string="Send on" required="1"/>
</group>
</group>
<footer>
@@ -69,7 +69,10 @@
</xpath>
<!-- Form -->
<xpath expr="//field[@name='subject']" position="attributes">
<attribute name="attrs">{'invisible': [('mailing_type', '!=', 'mail')]}</attribute>
<attribute name="attrs">{
'invisible': [('mailing_type', '!=', 'mail')],
'readonly': [('state', 'in', ('sending', 'done'))]}
</attribute>
</xpath>
<xpath expr="//page[@name='mail_body']" position="attributes">
<attribute name="attrs">{'invisible': [('mailing_type', '!=', 'mail')]}</attribute>
@@ -85,7 +88,10 @@
</xpath>
<!-- Option page tweaks -->
<xpath expr="//field[@name='email_from']" position="attributes">
<attribute name="attrs">{'invisible': [('mailing_type', '!=', 'mail')]}</attribute>
<attribute name="attrs">{
'invisible': [('mailing_type', '!=', 'mail')],
'readonly': [('state', 'in', ('sending', 'done'))]}
</attribute>
</xpath>
<xpath expr="//label[@for='reply_to']" position="attributes">
<attribute name="attrs">{'invisible': [('mailing_type', '!=', 'mail')]}</attribute>
@@ -100,7 +106,10 @@
<attribute name="attrs">{'invisible': [('mailing_type', '!=', 'mail')]}</attribute>
</xpath>
<xpath expr="//field[@name='mail_server_id']" position="attributes">
<attribute name="attrs">{'invisible': [('mailing_type', '!=', 'mail')]}</attribute>
<attribute name="attrs">{
'invisible': [('mailing_type', '!=', 'mail')],
'readonly': [('state', 'in', ('sending', 'done'))]}
</attribute>
</xpath>
</field>
</record>
+7 -3
View File
@@ -6,7 +6,7 @@
<field name="arch" type="xml">
<search string="UTM Campaigns">
<field name="name" string="Campaigns"/>
<field name="tag_ids"/>
<field name="tag_ids" widget="many2many_tags"/>
<field name="user_id"/>
<group expand="0" string="Group By">
<filter string="Stage" name="group_stage_id"
@@ -46,7 +46,7 @@
<field name="name"/>
<field name="user_id"/>
<field name="stage_id"/>
<field name="tag_ids"/>
<field name="tag_ids" widget="many2many_tags"/>
</tree>
</field>
</record>
@@ -120,6 +120,8 @@
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Add a new tag
</p><p>
Use tags to organize campaigns and easily filter them.
</p>
</field>
</record>
@@ -153,7 +155,9 @@
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new utm stage
Create a stage for your campaigns
</p><p>
Stages allow you to organize your workflow (e.g. : plan, design, in progress, done, …).
</p>
</field>
</record>