diff options
| author | ryv-odoo <ryv@odoo.com> | 2019-09-30 09:16:10 +0000 |
|---|---|---|
| committer | ryv-odoo <ryv@odoo.com> | 2019-09-30 09:27:17 +0000 |
| commit | 70519489e95da62cc7c44ba8b12b53768973b48b (patch) | |
| tree | 554d4dbea7d5eaca621842d6eda1cba99cc7e45c | |
| parent | eebeefcf8bd65bdfc020667352d842b919b1a50a (diff) | |
[IMP] mass_mailing(_sms) : improve mail/sms marketing forms
- In the mail/sms marketing form, compress all blue ribbons into
one to avoid multiple space between ribbons.
- In the sms marketing form, we add a clicked stat button to have
the same information that the kanban view.
- In the mail marketing form (when sms is enabled), when the state is in draft, stat buttons
opened and replied was present for no reason (only with sms marketing installed).
Fix by adding correct invisible condition.
TASK_ID 2075733
| -rw-r--r-- | addons/mass_mailing/views/mailing_mailing_views.xml | 72 | ||||
| -rw-r--r-- | addons/mass_mailing_sms/views/mailing_mailing_views.xml | 13 |
2 files changed, 48 insertions, 37 deletions
diff --git a/addons/mass_mailing/views/mailing_mailing_views.xml b/addons/mass_mailing/views/mailing_mailing_views.xml index 20aa910d783..757aed5e54a 100644 --- a/addons/mass_mailing/views/mailing_mailing_views.xml +++ b/addons/mass_mailing/views/mailing_mailing_views.xml @@ -56,35 +56,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': ['&','&',('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> @@ -287,8 +289,8 @@ <div class="o_kanban_record_headings"> <div class="row" attrs="{'invisible': [('sent_date', '=', False)]}"> <h3 class="my-1 col-8 o_text_overflow"> - <field name="subject"/> - </h3> + <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" @@ -313,27 +315,27 @@ <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> <div class="d-flex justify-content-between"> <div name="stat_opened"> <b><field name="opened_ratio" />%</b> Opened - </div> + </div> <div name="stat_replied"> <b><field name="replied_ratio" />%</b> Replied </div> <div name="stat_clicks"> <b><field name="clicks_ratio" />%</b> Clicks </div> + </div> </div> </div> - </div> <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='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> diff --git a/addons/mass_mailing_sms/views/mailing_mailing_views.xml b/addons/mass_mailing_sms/views/mailing_mailing_views.xml index dedfd377b0b..0d3329aafe9 100644 --- a/addons/mass_mailing_sms/views/mailing_mailing_views.xml +++ b/addons/mass_mailing_sms/views/mailing_mailing_views.xml @@ -82,11 +82,20 @@ <field name="sent" string="Sent" widget="statinfo"/> </button> </xpath> + <xpath expr="//button[@name='action_view_opened']" position="after"> + <button name="action_view_clicked" + type="object" + context="{'search_default_filter_clicked': True}" + class="oe_stat_button" + attrs="{'invisible': [('mailing_type', '!=', 'sms')]}"> + <field name="clicks_ratio" string="Clicked" widget="percentpie"/> + </button> + </xpath> <xpath expr="//button[@name='action_view_opened']" position="attributes"> - <attribute name="attrs">{'invisible': [('mailing_type', '!=', 'mail')]}</attribute> + <attribute name="attrs">{'invisible': ['|',('mailing_type', '!=', 'mail'),('state', 'in', ('draft','test'))]}</attribute> </xpath> <xpath expr="//button[@name='action_view_replied']" position="attributes"> - <attribute name="attrs">{'invisible': [('mailing_type', '!=', 'mail')]}</attribute> + <attribute name="attrs">{'invisible': ['|',('mailing_type', '!=', 'mail'),('state', 'in', ('draft','test'))]}</attribute> </xpath> <!-- Form --> <xpath expr="//page[@name='mail_body']" position="attributes"> |
