[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
This commit is contained in:
ryv-odoo
2019-09-12 14:53:44 +00:00
parent e4afa5d6d0
commit 8e2da3b4d6
16 changed files with 157 additions and 144 deletions
@@ -57,46 +57,40 @@
<field name="state" readonly="1" widget="statusbar"/>
</header>
<div class="alert alert-info text-center" attrs="{'invisible': [('ignored', '=', 0)]}" role="alert">
<p>
<button class="btn-link"
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>
</p>
<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">
<p>
<button class="btn-link"
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>
</p>
<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">
<p>
<button class="btn-link"
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>
</p>
<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 class="alert alert-info text-center" attrs="{'invisible': [('state', '!=', 'in_queue')]}" role="alert">
<p><strong>
This mailing is scheduled for
<strong>
<span name="next_departure_text">This mailing is scheduled for</span>
<field name="next_departure" class="oe_inline"/>.
</strong></p>
</strong>
</div>
<sheet>
<div class="oe_button_box" name="button_box">
@@ -140,7 +134,7 @@
<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="Mailing Name"/>
<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'))]}"/>
@@ -261,8 +255,11 @@
<field name='state' readonly="1"/>
<field name='email_from' readonly="1"/>
<field name='color'/>
<field name='user_id'/>
<field name='expected'/>
<field name='failed'/>
<field name='total'/>
<field name='mailing_model_id'/>
<field name='sent_date'/>
<field name='active'/>
<templates>
@@ -286,11 +283,14 @@
<div class="oe_kanban_content">
<div class="o_kanban_record_top">
<div class="o_kanban_record_headings">
<h3 class="mt4 mb4"><field name="name"/></h3>
<h3 class="mt4 mb4">
<field name="name"/>
</h3>
<field name="mailing_type" invisible="1"/>
<div class="o_kanban_record_subtitle" attrs="{'invisible': [('sent_date', '=', False)]}">
<h5 style="display: inline;"><field name="campaign_id" groups="mass_mailing.group_mass_mailing_campaign"/></h5>
<t t-if="record.campaign_id.raw_value" groups="mass_mailing.group_mass_mailing_campaign"> - </t><field name="sent_date"/>
<h5 style="display: inline;">
<field name="campaign_id" groups="mass_mailing.group_mass_mailing_campaign"/>
</h5>
</div>
</div>
</div>
@@ -298,9 +298,7 @@
<t t-if="record.sent_date">
<div class="row" name="stat_opened">
<div class="col-8">
<a name="%(action_view_mail_mail_statistics_mailing)d"
context="{'search_default_filter_opened': True}"
type="action">Opened</a>
Opened
</div>
<div class="col-4 text-right">
<field name="opened_ratio"/> %
@@ -308,9 +306,7 @@
</div>
<div class="row" name="stat_replied">
<div class="col-8">
<a name="%(action_view_mail_mail_statistics_mailing)d"
context="{'search_default_filter_replied': True}"
type="action">Replied</a>
Replied
</div>
<div class="col-4 text-right">
<field name="replied_ratio"/> %
@@ -318,20 +314,26 @@
</div>
<div class="row" name="stat_clicks">
<div class="col-8">
<a name="%(link_tracker_action_mass_mailing)d"
type="action">Clicks</a>
Clicks
</div>
<div class="col-4 text-right">
<field name="clicks_ratio"/> %
</div>
</div>
<div class='o_kanban_primary_bottom' name="stat_delivered">
<div class='mt-1' name="stat_delivered">
<field name="delivered" widget="progressbar" title="Delivered" options="{'current_value': 'delivered', 'max_value': 'expected', 'editable': false}"/>
</div>
</t>
</div>
</div>
<div class="oe_clear"></div>
<div>
<span class="fa fa-clock-o text-muted mr-2" attrs="{'invisible': [('sent_date', '=', False)]}"/><field name="sent_date"/>
<img t-att-src="kanban_image('res.users', 'image_64', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="24" height="24" class="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>
+1 -1
View File
@@ -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),
@@ -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',
@@ -52,19 +52,19 @@
<!-- Actions and Menuitems -->
<record id="mailing_trace_report_action_sms" model="ir.actions.act_window">
<field name="name">Mass SMS Analysis</field>
<field name="name">SMS Marketing Analysis</field>
<field name="res_model">mailing.trace.report</field>
<field name="view_mode">graph,pivot</field>
<field name="domain">[('mailing_type', '=', 'sms')]</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
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.
</p>
</field>
</record>
<!-- Mass SMS / Reporting -->
<!-- SMS Marketing / Reporting -->
<record id="mass_mailing_sms_menu_reporting" model="ir.ui.menu">
<field name="action" ref="mailing_trace_report_action_sms"/>
</record>
@@ -6,7 +6,8 @@
<field name="inherit_id" ref="mass_mailing.view_mail_mass_mailing_contact_search"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='name']" position="after">
<field name="phone_sanitized"/>
<field name="mobile"/>
<field name="phone_sanitized" invisible="1"/>
</xpath>
<xpath expr="//filter[@name='filter_not_optout']" position="after">
<separator/>
@@ -31,7 +32,8 @@
<field name="create_date"/>
<field name="name"/>
<field name="company_name"/>
<field name="phone_sanitized"/>
<field name="mobile"/>
<field name="phone_sanitized" invisible="1"/>
<field name="phone_blacklisted"/>
<field name="opt_out" invisible="'default_list_ids' not in context"/>
</tree>
@@ -43,18 +45,13 @@
<field name="model">mailing.contact</field>
<field name="inherit_id" ref="mass_mailing.view_mail_mass_mailing_contact_form"/>
<field name="arch" type="xml">
<xpath expr="//label[@for='email']" position="attributes">
<attribute name="invisible">context.get('mailing_sms') == True</attribute>
</xpath>
<xpath expr="//div[@name='email_details']" position="attributes">
<attribute name="invisible">context.get('mailing_sms') == True</attribute>
</xpath>
<xpath expr="//div[@name='email_details']" position="after">
<label for="phone_sanitized" class="oe_inline"/>
<label for="mobile" class="oe_inline"/>
<div class="o_row o_row_readonly" name="phone_details">
<i class="fa fa-ban" style="color: red;" role="img" title="This number is blacklisted for mass SMS"
<i class="fa fa-ban" style="color: red;" role="img" title="This number is blacklisted for SMS Marketing"
aria-label="Phone Blacklisted" attrs="{'invisible': [('phone_blacklisted', '=', False)]}" groups="base.group_user"></i>
<field name="phone_sanitized" widget="phone"/>
<field name="mobile" widget="phone"/>
<field name="phone_sanitized" invisible="1"/>
<field name="phone_blacklisted" invisible="1"/>
</div>
</xpath>
@@ -67,10 +64,11 @@
<field name="inherit_id" ref="mass_mailing.view_mail_mass_mailing_contact_kanban"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='email']" position="after">
<field name="phone_sanitized"/>
<field name="mobile"/>
<field name="phone_sanitized" invisible="1"/>
</xpath>
<xpath expr="//t[@t-esc='record.email.value']" position="after">
<t t-esc="record.phone_sanitized.value"/>
<t t-esc="record.mobile.value"/>
</xpath>
</field>
</record>
@@ -88,7 +86,7 @@
</field>
</record>
<!-- Mass SMS / Contacts Lists / Contacts Lists -->
<!-- SMS Marketing / Contacts Lists / Contacts Lists -->
<record id="mass_mailing_sms.mailing_contact_menu_sms" model="ir.ui.menu">
<field name="action" ref="mailing_contact_action_sms"/>
</record>
@@ -15,7 +15,7 @@
</field>
</record>
<!-- Mass SMS / Contacts Lists / Contacts Lists -->
<!-- SMS Marketing / Contacts Lists / Contacts Lists -->
<record id="mass_mailing_sms.mailing_list_menu_sms" model="ir.ui.menu">
<field name="action" ref="mailing_list_action_sms"/>
</record>
@@ -1,6 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo><data>
<record id="mailing_mailing_view_form" model="ir.ui.view">
<record model="ir.ui.view" id="mailing_mailing_view_search_sms">
<field name="name">mailing.mailing.search</field>
<field name="model">mailing.mailing</field>
<field name="inherit_id" ref="mass_mailing.view_mail_mass_mailing_search"/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<xpath expr="//filter[@name='assigned_to_me']" position="attributes">
<attribute name="string">My SMS Marketing</attribute>
</xpath>
</field>
</record>
<record id="mailing_mailing_view_form_sms" model="ir.ui.view">
<field name="name">mailing.mailing.view.form.inherit.sms</field>
<field name="model">mailing.mailing</field>
<field name="inherit_id" ref="mass_mailing.view_mail_mass_mailing_form"/>
@@ -19,15 +32,13 @@
<xpath expr="//header" position="after">
<field name="sms_has_insufficient_credit" invisible="1"/>
<div class="alert alert-warning text-center" attrs="{'invisible': [('sms_has_insufficient_credit', '=', False)]}" role="alert">
<p>
<button class="btn-link"
name="action_buy_sms_credits"
type="object">
<strong>
It appears you don't have enough IAP credits. Click here to buy credits.
</strong>
</button>
</p>
<button class="btn-link py-0"
name="action_buy_sms_credits"
type="object">
<strong>
It appears you don't have enough IAP credits. Click here to buy credits.
</strong>
</button>
</div>
</xpath>
<xpath expr="//span[@name='ignored_text']" position="attributes">
@@ -48,6 +59,12 @@
<xpath expr="//span[@name='failed_text']" position="after">
<span name="failed_text_sms" attrs="{'invisible': [('mailing_type', '!=', 'sms')]}">SMS Text Message could not be sent.</span>
</xpath>
<xpath expr="//span[@name='next_departure_text']" position='attributes'>
<attribute name="attrs">{'invisible': [('mailing_type', '!=', 'mail')]}</attribute>
</xpath>
<xpath expr="//span[@name='next_departure_text']" position='after'>
<span name="next_departure_text" attrs="{'invisible': [('mailing_type', '!=', 'sms')]}">This SMS marketing is scheduled for</span>
</xpath>
<!-- Stat Buttons -->
<xpath expr="//button[@id='button_view_sent']" position="attributes">
<attribute name="attrs">{'invisible': ['|', '&amp;', ('sent', '=', 0), ('state', 'in', ('draft', 'test')), ('mailing_type', '!=', 'mail')]}</attribute>
@@ -81,7 +98,6 @@
<page string="SMS Content" name="sms_body" attrs="{'invisible': [('mailing_type', '!=', 'sms')]}">
<field name="body_plaintext" widget="sms_widget"/>
<group>
<field name="sms_template_id" domain="[('model', '=', mailing_model_real)]"/>
<field name="sms_allow_unsubscribe"/>
</group>
</page>
@@ -114,7 +130,7 @@
</field>
</record>
<record id="mailing_mailing_view_kanban" model="ir.ui.view">
<record id="mailing_mailing_view_kanban_sms" model="ir.ui.view">
<field name="name">mailing.mailing.view.kanban.inherit.sms</field>
<field name="model">mailing.mailing</field>
<field name="inherit_id" ref="mass_mailing.view_mail_mass_mailing_kanban"/>
@@ -122,18 +138,17 @@
<xpath expr="//field[@name='active']" position="after">
<field name="sms_has_insufficient_credit"/>
</xpath>
<xpath expr="//h3" position="after">
<div class="alert alert-warning" role="alert" attrs="{'invisible': [('sms_has_insufficient_credit', '=', False)]}">
<a name="action_buy_sms_credits"
type="object">Insufficient credits</a>
</div>
</xpath>
<xpath expr="//div[@name='stat_opened']" position="attributes">
<attribute name="attrs">{'invisible': [('mailing_type', '!=', 'mail')]}</attribute>
</xpath>
<xpath expr="//div[@name='stat_replied']" position="attributes">
<attribute name="attrs">{'invisible': [('mailing_type', '!=', 'mail')]}</attribute>
</xpath>
</xpath>
<xpath expr="//div[@name='div_total_model']" position="after">
<div class="alert alert-warning" role="alert" attrs="{'invisible': ['&amp;',('sms_has_insufficient_credit', '=', False), ('mailing_type', '!=', 'mail')]}">
<a name="action_buy_sms_credits" type="object">Insufficient credits</a>
</div>
</xpath>
</field>
</record>
@@ -142,7 +157,7 @@
<field name="model">mailing.mailing</field>
<field name="priority">20</field>
<field name="arch" type="xml">
<tree string="Mass SMS">
<tree string="SMS Marketing">
<field name="name"/>
<field name="mailing_type" invisible="1"/>
<field name="sent"/>
@@ -154,9 +169,10 @@
</record>
<record id="mailing_mailing_action_sms" model="ir.actions.act_window">
<field name="name">Mass SMS</field>
<field name="name">SMS Marketing</field>
<field name="res_model">mailing.mailing</field>
<field name="view_mode">kanban,tree,form,graph</field>
<field name="search_view_id" ref="mailing_mailing_view_search_sms"/>
<field name="domain">[('mailing_type', '=', 'sms')]</field>
<field name="context">{
'search_default_assigned_to_me': 1,
@@ -165,7 +181,7 @@
}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new mass SMS
Create a new SMS Marketing
</p><p>
You can easily send SMS to any contact saved in other Odoo apps.
</p>
@@ -174,7 +190,7 @@
<record id="mailing_mailing_action_sms_view_kanban" model="ir.actions.act_window.view">
<field name="sequence">1</field>
<field name="view_mode">kanban</field>
<field name="view_id" ref="mass_mailing.view_mail_mass_mailing_kanban"/>
<field name="view_id" ref="mailing_mailing_view_kanban_sms"/>
<field name="act_window_id" ref="mailing_mailing_action_sms"/>
</record>
<record id="mailing_mailing_action_sms_view_tree" model="ir.actions.act_window.view">
@@ -184,7 +200,7 @@
<field name="act_window_id" ref="mailing_mailing_action_sms"/>
</record>
<!-- Mass SMS / Mass SMS -->
<!-- SMS Marketing / SMS Marketing -->
<record id="mass_mailing_sms_menu_mass_sms" model="ir.ui.menu">
<field name="action" ref="mailing_mailing_action_sms"/>
</record>
@@ -1,59 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Mass SMS -->
<!-- SMS Marketing -->
<menuitem id="mass_mailing_sms_menu_root"
name="Mass SMS"
name="SMS Marketing"
sequence="60"
web_icon="mass_mailing_sms,static/description/icon.png"
groups="mass_mailing.group_mass_mailing_user"/>
<!-- Mass SMS / Mass SMS -->
<!-- SMS Marketing / SMS Marketing -->
<menuitem id="mass_mailing_sms_menu_mass_sms"
name="Mass SMS"
name="SMS Marketing"
parent="mass_mailing_sms_menu_root"
sequence="1"
groups="mass_mailing.group_mass_mailing_user"/>
<!-- Mass SMS / Contacts Lists -->
<!-- SMS Marketing / Contacts Lists -->
<menuitem id="mass_mailing_sms_menu_contacts"
name="Contacts Lists"
parent="mass_mailing_sms_menu_root"
sequence="2"
groups="mass_mailing.group_mass_mailing_user"/>
<!-- Mass SMS / Contacts Lists / Contacts Lists -->
<!-- SMS Marketing / Contacts Lists / Contacts Lists -->
<menuitem id="mailing_list_menu_sms"
name="Contacts Lists"
parent="mass_mailing_sms_menu_contacts"
sequence="1"
groups="mass_mailing.group_mass_mailing_user"/>
<!-- Mass SMS / Contacts Lists / Contacts -->
<!-- SMS Marketing / Contacts Lists / Contacts -->
<menuitem id="mailing_contact_menu_sms"
name="Contacts"
parent="mass_mailing_sms_menu_contacts"
sequence="2"
groups="mass_mailing.group_mass_mailing_user"/>
<!-- Mass SMS / Reporting -->
<!-- SMS Marketing / Reporting -->
<menuitem id="mass_mailing_sms_menu_reporting"
name="Reporting"
parent="mass_mailing_sms_menu_root"
sequence="80"
groups="mass_mailing.group_mass_mailing_user"/>
<!-- Mass SMS / Configuration -->
<!-- SMS Marketing / Configuration -->
<menuitem id="mass_mailing_sms_menu_configuration"
name="Configuration"
parent="mass_mailing_sms_menu_root"
sequence="100"
groups="mass_mailing.group_mass_mailing_user"/>
<!-- Mass SMS / Configuration / Blacklist -->
<!-- SMS Marketing / Configuration / Blacklist -->
<menuitem id="phone_blacklist_menu"
name="Phone Blacklist"
parent="mass_mailing_sms_menu_configuration"
sequence="1"
action="phone_validation.phone_blacklist_action"
groups="mass_mailing.group_mass_mailing_user"/>
<!-- Mass SMS / Configuration / Link Tracker -->
<!-- SMS Marketing / Configuration / Link Tracker -->
<menuitem id="link_tracker_menu"
name="Link Tracker Blacklist"
parent="mass_mailing_sms_menu_configuration"
@@ -25,7 +25,7 @@ class MassSMSTest(models.TransientModel):
sanitized_numbers = [info['sanitized'] for info in sanitize_res.values() if info['sanitized']]
invalid_numbers = [number for number, info in sanitize_res.items() if info['code']]
if invalid_numbers:
raise exceptions.UserError(_('Following numbers are not correctly encoded: %s') % repr(invalid_numbers))
raise exceptions.UserError(_('Following numbers are not correctly encoded: %s, example : "+32 495 85 85 77, +33 545 55 55 55"') % repr(invalid_numbers))
self.sanitized_numbers = ','.join(sanitized_numbers)
else:
self.sanitized_numbers = False
@@ -6,11 +6,11 @@
<field name="arch" type="xml">
<form string="Send a Sample SMS">
<p class="text-muted">
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).
</p>
<group>
<field name="numbers"/>
<field name="sanitized_numbers" invisible="0"/>
<field name="numbers" placeholder="+32 495 85 85 77, +33 545 55 55 55"/>
<field name="sanitized_numbers" invisible="1"/>
<field name="mailing_id" invisible="1"/>
</group>
<footer>
@@ -22,7 +22,7 @@
</record>
<record id="mailing_sms_test_action" model="ir.actions.act_window">
<field name="name">Test SMS Mailing</field>
<field name="name">Test SMS Marketing</field>
<field name="res_model">mailing.sms.test</field>
<field name="view_mode">form</field>
<field name="target">new</field>
@@ -52,7 +52,7 @@
<p class="o_view_nocontent_smiling_face">
Add a phone number in the blacklist
</p><p>
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.
</p>
</field>
</record>
+23 -23
View File
@@ -18,20 +18,20 @@
<field name="author_id" ref="base.partner_admin"/>
<field name="date" eval="(DateTime.today() - timedelta(days=4)).strftime('%Y-%m-%d %H:%M:00')"/>
</record>
<record id="message_demo_partner_1_2_notif_0" model="mail.notification">
<field name="mail_message_id" ref="message_demo_partner_1_1"/>
<field name="res_partner_id" ref="base.res_partner_address_28"/>
<field name="notification_type">email</field>
<field name="notification_status">exception</field>
<field name="failure_type">SMTP</field>
</record>
<record id="message_demo_partner_1_2_notif_0" model="mail.notification">
<field name="mail_message_id" ref="message_demo_partner_1_1"/>
<field name="res_partner_id" ref="base.res_partner_address_28"/>
<field name="notification_type">email</field>
<field name="notification_status">exception</field>
<field name="failure_type">SMTP</field>
</record>
<record id="message_demo_partner_1_2" model="mail.message">
<field name="model">res.partner</field>
<field name="res_id" ref="base.res_partner_address_28"/>
<field name="body" type="html"><p>Hello! This is an example of SMS.</p></field>
<field name="message_type">sms</field>
<field name="subtype_id" ref="mail.mt_comment"/>
<field name="subtype_id" ref="mail.mt_note"/>
<field name="author_id" ref="base.partner_demo"/>
<field name="date" eval="(DateTime.today() - timedelta(days=3)).strftime('%Y-%m-%d %H:%M:00')"/>
</record>
@@ -40,23 +40,23 @@
<field name="res_id" ref="base.res_partner_address_28"/>
<field name="body" type="html"><p>Hello! This is an example of another SMS with notifications.</p></field>
<field name="message_type">sms</field>
<field name="subtype_id" ref="mail.mt_comment"/>
<field name="subtype_id" ref="mail.mt_note"/>
<field name="author_id" ref="base.partner_admin"/>
<field name="date" eval="(DateTime.today() - timedelta(days=2)).strftime('%Y-%m-%d %H:%M:00')"/>
</record>
<record id="message_demo_partner_1_3_notif_0" model="mail.notification">
<field name="mail_message_id" ref="message_demo_partner_1_3"/>
<field name="res_partner_id" ref="base.res_partner_address_28"/>
<field name="notification_type">sms</field>
<field name="notification_status">exception</field>
<field name="failure_type">sms_credit</field>
</record>
<record id="message_demo_partner_1_3_notif_1" model="mail.notification">
<field name="mail_message_id" ref="message_demo_partner_1_3"/>
<field name="res_partner_id" ref="base.res_partner_address_16"/>
<field name="notification_type">sms</field>
<field name="notification_status">exception</field>
<field name="failure_type">sms_credit</field>
</record>
<record id="message_demo_partner_1_3_notif_0" model="mail.notification">
<field name="mail_message_id" ref="message_demo_partner_1_3"/>
<field name="res_partner_id" ref="base.res_partner_address_28"/>
<field name="notification_type">sms</field>
<field name="notification_status">exception</field>
<field name="failure_type">sms_credit</field>
</record>
<record id="message_demo_partner_1_3_notif_1" model="mail.notification">
<field name="mail_message_id" ref="message_demo_partner_1_3"/>
<field name="res_partner_id" ref="base.res_partner_address_16"/>
<field name="notification_type">sms</field>
<field name="notification_status">exception</field>
<field name="failure_type">sms_credit</field>
</record>
</data></odoo>
+4 -1
View File
@@ -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")
+1 -1
View File
@@ -9,7 +9,7 @@
<field name="priority">10</field>
<field name="arch" type="xml">
<xpath expr="//field[@name='mobile']" position="after">
<field name="phone_sanitized" groups="base.group_no_one"/>
<field name="phone_sanitized" groups="base.group_no_one" invisible="1"/>
</xpath>
<xpath expr="//field[@name='phone']" position="replace">
<label for="phone"/>
+2 -3
View File
@@ -36,7 +36,7 @@
<group>
<field name="model_id" required="1" options="{'no_create': True}"/>
<field name="model" invisible="1"/>
<field name="lang"/>
<field name="lang" groups="base.group_no_one" placeholder="e.g. en_US or ${object.partner_id.lang}"/>
</group>
</div>
<notebook>
@@ -97,5 +97,4 @@
sequence="2"
action="sms_template_action"/>
</data>
</odoo>
</data></odoo>
+3 -8
View File
@@ -21,9 +21,9 @@
<!-- Mass mode information (res_ids versus active domain) -->
<div colspan="2" class="alert alert-info text-center mb-3" role="alert"
attrs="{'invisible': [('composition_mode', '=', 'comment')]}">
<p>
<p class="my-0">
<span attrs="{'invisible': [('use_active_domain', '=', 'True')]}">
<field class="oe_inline font-weight-bold" name="res_ids_count"/> visible records selected.
<field class="oe_inline font-weight-bold" name="res_ids_count"/> records selected.
</span>
Check <field class="oe_inline ml-2" name="use_active_domain"/> to send to all
<field class="oe_inline font-weight-bold ml-2" name="active_domain_count"/> records instead. <br/>
@@ -31,16 +31,11 @@
and <field class="oe_inline font-weight-bold" name="recipient_invalid_count"/> are invalid.
</p>
</div>
<field name="template_id" options="{'no_create': True}" attrs="{'invisible': [('composition_mode', '!=', 'mass')]}"/>
<field name="recipient_description" string="Recipients"
readonly="1"
attrs="{'invisible': [('composition_mode', '!=', 'comment')]}"/>
<field name="body" widget="sms_widget"/>
</group>
<group>
<group>
<field name="mass_keep_log" invisible="1"/>
</group>
<field name="mass_keep_log" invisible="1"/>
</group>
</sheet>
<footer>