From 8e2da3b4d6f88160041526676fd77a97256cd6e7 Mon Sep 17 00:00:00 2001 From: ryv-odoo Date: Thu, 5 Sep 2019 15:21:33 +0000 Subject: [PATCH] [IMP] (sms_)mass_mailing: improve interface - Change the name of "Mass SMS" by "SMS Marketing" - Improve the Mass Mailing views (kanban, form) - Improve the Mass SMS views (kanban, search, form) - Hide the sanitized numbers from views (sometime replace by mobile) - Fix demo data of sms - Explain the language field of sms template - Improve the render of the sms composer wizard TASK_ID : 2053631 --- .../views/mailing_mailing_views.xml | 96 ++++++++++--------- addons/mass_mailing_sms/controllers/main.py | 2 +- .../models/mailing_mailing.py | 2 +- .../report/mailing_trace_report_views.xml | 6 +- .../views/mailing_contact_views.xml | 26 +++-- .../views/mailing_list_views.xml | 2 +- .../views/mailing_mailing_views.xml | 64 ++++++++----- .../views/mailing_sms_menus.xml | 22 ++--- .../wizard/mailing_sms_test.py | 2 +- .../wizard/mailing_sms_test_views.xml | 8 +- .../views/phone_blacklist_views.xml | 2 +- addons/sms/data/mail_demo.xml | 46 ++++----- addons/sms/models/sms_template.py | 5 +- addons/sms/views/res_partner_views.xml | 2 +- addons/sms/views/sms_template_views.xml | 5 +- addons/sms/wizard/sms_composer_views.xml | 11 +-- 16 files changed, 157 insertions(+), 144 deletions(-) diff --git a/addons/mass_mailing/views/mailing_mailing_views.xml b/addons/mass_mailing/views/mailing_mailing_views.xml index 96456cf2afa..6f5ac26adde 100644 --- a/addons/mass_mailing/views/mailing_mailing_views.xml +++ b/addons/mass_mailing/views/mailing_mailing_views.xml @@ -57,46 +57,40 @@
@@ -140,7 +134,7 @@ - + @@ -261,8 +255,11 @@ + + + @@ -286,11 +283,14 @@
-

+

+ +

-
- - +
+ +
@@ -298,9 +298,7 @@
- Opened + Opened
% @@ -308,9 +306,7 @@
- Replied + Replied
% @@ -318,20 +314,26 @@
- Clicks + Clicks
%
-
+
-
+
+ + +
+
+ + +
diff --git a/addons/mass_mailing_sms/controllers/main.py b/addons/mass_mailing_sms/controllers/main.py index 9f03af5c6d2..0fc9569641f 100644 --- a/addons/mass_mailing_sms/controllers/main.py +++ b/addons/mass_mailing_sms/controllers/main.py @@ -65,7 +65,7 @@ class MailingSMSController(http.Controller): else: blacklist_rec = request.env['phone.blacklist'].sudo().add(tocheck_number) blacklist_rec._message_log( - body=_('Blacklist through mass sms unsubscribe (mailing ID: %s - model: %s)') % + body=_('Blacklist through SMS Marketing unsubscribe (mailing ID: %s - model: %s)') % (trace.mass_mailing_id.id, trace.mass_mailing_id.mailing_model_id.display_name)) lists_optin = request.env['mailing.contact.subscription'].sudo().search([ ('contact_id.phone_sanitized', '=', tocheck_number), diff --git a/addons/mass_mailing_sms/models/mailing_mailing.py b/addons/mass_mailing_sms/models/mailing_mailing.py index 96e3eb4c8d1..374fac93c77 100644 --- a/addons/mass_mailing_sms/models/mailing_mailing.py +++ b/addons/mass_mailing_sms/models/mailing_mailing.py @@ -69,7 +69,7 @@ class Mailing(models.Model): if self.mailing_type == 'sms': ctx = dict(self.env.context, default_mailing_id=self.id) return { - 'name': _('Test Mailing'), + 'name': _('Test SMS marketing'), 'type': 'ir.actions.act_window', 'view_mode': 'form', 'res_model': 'mailing.sms.test', diff --git a/addons/mass_mailing_sms/report/mailing_trace_report_views.xml b/addons/mass_mailing_sms/report/mailing_trace_report_views.xml index 2adf5953faf..565ccfc79e0 100644 --- a/addons/mass_mailing_sms/report/mailing_trace_report_views.xml +++ b/addons/mass_mailing_sms/report/mailing_trace_report_views.xml @@ -52,19 +52,19 @@ - Mass SMS Analysis + SMS Marketing Analysis mailing.trace.report graph,pivot [('mailing_type', '=', 'sms')]

- Mass SMS Statistics allows you to check different mailing related information like number of sent SMS or bounced SMS. + SMS Marketing Statistics allows you to check different mailing related information like number of sent SMS or bounced SMS. You can sort out your analysis by different groups to get accurate grained analysis.

- + diff --git a/addons/mass_mailing_sms/views/mailing_contact_views.xml b/addons/mass_mailing_sms/views/mailing_contact_views.xml index 374191ec91f..eb2d7e57384 100644 --- a/addons/mass_mailing_sms/views/mailing_contact_views.xml +++ b/addons/mass_mailing_sms/views/mailing_contact_views.xml @@ -6,7 +6,8 @@ - + + @@ -31,7 +32,8 @@ - + + @@ -43,18 +45,13 @@ mailing.contact - - context.get('mailing_sms') == True - - - context.get('mailing_sms') == True - - @@ -67,10 +64,11 @@ - + + - + @@ -88,7 +86,7 @@ - + diff --git a/addons/mass_mailing_sms/views/mailing_list_views.xml b/addons/mass_mailing_sms/views/mailing_list_views.xml index d1b88669078..de57e354b01 100644 --- a/addons/mass_mailing_sms/views/mailing_list_views.xml +++ b/addons/mass_mailing_sms/views/mailing_list_views.xml @@ -15,7 +15,7 @@ - + diff --git a/addons/mass_mailing_sms/views/mailing_mailing_views.xml b/addons/mass_mailing_sms/views/mailing_mailing_views.xml index 964af78e5f6..0b8d47637f1 100644 --- a/addons/mass_mailing_sms/views/mailing_mailing_views.xml +++ b/addons/mass_mailing_sms/views/mailing_mailing_views.xml @@ -1,6 +1,19 @@ - + + + mailing.mailing.search + mailing.mailing + + primary + + + My SMS Marketing + + + + + mailing.mailing.view.form.inherit.sms mailing.mailing @@ -19,15 +32,13 @@ @@ -48,6 +59,12 @@ SMS Text Message could not be sent. + + {'invisible': [('mailing_type', '!=', 'mail')]} + + + This SMS marketing is scheduled for + {'invisible': ['|', '&', ('sent', '=', 0), ('state', 'in', ('draft', 'test')), ('mailing_type', '!=', 'mail')]} @@ -81,7 +98,6 @@ - @@ -114,7 +130,7 @@ - + mailing.mailing.view.kanban.inherit.sms mailing.mailing @@ -122,18 +138,17 @@ - - - {'invisible': [('mailing_type', '!=', 'mail')]} {'invisible': [('mailing_type', '!=', 'mail')]} - + + + + @@ -142,7 +157,7 @@ mailing.mailing 20 - + @@ -154,9 +169,10 @@ - Mass SMS + SMS Marketing mailing.mailing kanban,tree,form,graph + [('mailing_type', '=', 'sms')] { 'search_default_assigned_to_me': 1, @@ -165,7 +181,7 @@ }

- Create a new mass SMS + Create a new SMS Marketing

You can easily send SMS to any contact saved in other Odoo apps.

@@ -174,7 +190,7 @@ 1 kanban - + @@ -184,7 +200,7 @@ - + diff --git a/addons/mass_mailing_sms/views/mailing_sms_menus.xml b/addons/mass_mailing_sms/views/mailing_sms_menus.xml index f7cc0f05edb..f009c9df330 100644 --- a/addons/mass_mailing_sms/views/mailing_sms_menus.xml +++ b/addons/mass_mailing_sms/views/mailing_sms_menus.xml @@ -1,59 +1,59 @@ - + - + - + - + - + - + - + - + - +

- Send a sample SMS for testing purpose to the numbers below. + Send a sample SMS for testing purpose to the numbers below (comma-separated list).

- - + +
@@ -22,7 +22,7 @@ - Test SMS Mailing + Test SMS Marketing mailing.sms.test form new diff --git a/addons/phone_validation/views/phone_blacklist_views.xml b/addons/phone_validation/views/phone_blacklist_views.xml index 4d76576cefa..d0b3b47eb04 100644 --- a/addons/phone_validation/views/phone_blacklist_views.xml +++ b/addons/phone_validation/views/phone_blacklist_views.xml @@ -52,7 +52,7 @@

Add a phone number in the blacklist

- Blacklisted phone numbers means that the recipient won't receive mass SMS anymore. + Blacklisted phone numbers means that the recipient won't receive SMS Marketing anymore.

diff --git a/addons/sms/data/mail_demo.xml b/addons/sms/data/mail_demo.xml index 103a89fbd8c..8086bef21fe 100644 --- a/addons/sms/data/mail_demo.xml +++ b/addons/sms/data/mail_demo.xml @@ -18,20 +18,20 @@ - - - - email - exception - SMTP - + + + + email + exception + SMTP + res.partner

Hello! This is an example of SMS.

sms - +
@@ -40,23 +40,23 @@

Hello! This is an example of another SMS with notifications.

sms - + - - - - sms - exception - sms_credit - - - - - sms - exception - sms_credit - + + + + sms + exception + sms_credit + + + + + sms + exception + sms_credit + diff --git a/addons/sms/models/sms_template.py b/addons/sms/models/sms_template.py index 3d5c229458d..e1ba74d3bb1 100644 --- a/addons/sms/models/sms_template.py +++ b/addons/sms/models/sms_template.py @@ -23,7 +23,10 @@ class SMSTemplate(models.Model): help="The type of document this template can be used with") model = fields.Char('Related Document Model', related='model_id.model', index=True, store=True, readonly=True) body = fields.Char('Body', translate=True, required=True) - lang = fields.Char('Language', placeholder="${object.partner_id.lang}") + lang = fields.Char('Language', help="Use this field to either force a specific language (ISO code) or dynamically " + "detect the language of your recipient by a placeholder expression " + "(e.g. ${object.partner_id.lang})") + # Use to create contextual action (same as for email template) sidebar_action_id = fields.Many2one('ir.actions.act_window', 'Sidebar action', readonly=True, copy=False, help="Sidebar action to make this template available on records " "of the related document model") diff --git a/addons/sms/views/res_partner_views.xml b/addons/sms/views/res_partner_views.xml index 455571be093..91c6b77c9b2 100644 --- a/addons/sms/views/res_partner_views.xml +++ b/addons/sms/views/res_partner_views.xml @@ -9,7 +9,7 @@ 10 - +
@@ -97,5 +97,4 @@ sequence="2" action="sms_template_action"/> - - + diff --git a/addons/sms/wizard/sms_composer_views.xml b/addons/sms/wizard/sms_composer_views.xml index abaa3e7af09..1cb59d99dd3 100644 --- a/addons/sms/wizard/sms_composer_views.xml +++ b/addons/sms/wizard/sms_composer_views.xml @@ -21,9 +21,9 @@ - -
- - - - +