PURPOSE
Purpose of this commit is to add options and improve sms composer behavior.
Followup of merge 4287481bf0 .
SPECIFICATIONS
* mass mode: add an option to keep archives when doing mass sms. This mode
is actually a _message_sms in batch using the note subtype to speedup the
process;
* improve _message_sms_schedule_mass to allow more fine-tuning of options
when calling it;
* do not block sending SMS in batch if some recipients are invalid. Indeed
using notifications there will be traces of failed SMS;
* avoid reload of form view;
Linked to task 1925950 and 1935280
Part of PR #34864
85 lines
4.8 KiB
XML
85 lines
4.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<record id="sms_composer_view_form" model="ir.ui.view">
|
|
<field name="name">sms.composer.view.form</field>
|
|
<field name="model">sms.composer</field>
|
|
<field name="arch" type="xml">
|
|
<form string="Send an SMS">
|
|
<sheet>
|
|
<group>
|
|
<field name="composition_mode" invisible="1"/>
|
|
<field name="res_id" invisible="1"/>
|
|
<field name="res_ids" invisible="1"/>
|
|
<field name="active_domain" invisible="1"/>
|
|
<field name="res_model" invisible="1"/>
|
|
<field name="mass_force_send" invisible="1"/>
|
|
<field name="number_field_name" invisible="1"/>
|
|
<field name="partner_ids" invisible="1"/>
|
|
<field name="numbers" invisible="1"/>
|
|
<field name="sanitized_numbers" invisible="1"/>
|
|
|
|
<!-- Recipient warning -->
|
|
<div colspan="2" class="alert alert-danger" role="alert"
|
|
attrs="{'invisible': [('recipient_invalid', '=', False)]}">
|
|
<strong>Some recipients are invalid</strong><br />
|
|
<field name="recipient_invalid"/>
|
|
</div>
|
|
<!-- Mass mode information (res_ids versus active domain) -->
|
|
<div colspan="2" class="oe_form_box_info bg-info oe_text_center mb-3"
|
|
attrs="{'invisible': [('composition_mode', '=', 'comment')]}">
|
|
<p attrs="{'invisible': [('use_active_domain', '=', False)]}">
|
|
<strong>All records matching your current search filter will receive a SMS,
|
|
not only the ids selected in the list view.</strong><br />
|
|
The SMS will be sent for all the records selected in the list.<br />
|
|
Confirming this wizard will probably take a few minutes blocking your browser.
|
|
</p>
|
|
<p attrs="{'invisible': [('use_active_domain', '=', True)]}">
|
|
<strong>Only records checked in list view will be used.</strong><br />
|
|
The SMS will be sent for all the records selected in the list.
|
|
</p>
|
|
<p class="mt8">
|
|
<span attrs="{'invisible': [('use_active_domain', '=', True)]}">
|
|
If you want to send it for all the records matching your search criterion, check this box :
|
|
</span>
|
|
<span attrs="{'invisible': [('use_active_domain', '=', False)]}">
|
|
If you want to use only selected records please uncheck this selection box :
|
|
</span>
|
|
<field class="oe_inline" name="use_active_domain"/>
|
|
</p>
|
|
</div>
|
|
|
|
<label for="partner_ids" string="Recipients"/>
|
|
<div>
|
|
<span attrs="{'invisible': ['|', ('composition_mode', '!=', 'mass'), ('use_active_domain', '=', False)]}">
|
|
<strong>Mass SMS</strong> on the current search filter
|
|
</span>
|
|
<field name="recipient_description" readonly="1" attrs="{
|
|
'invisible': [('use_active_domain', '=', True)]}"
|
|
/>
|
|
</div>
|
|
<field name="body" widget="sms_widget"/>
|
|
</group>
|
|
<group>
|
|
<group>
|
|
<field name="template_id" options="{'no_create': True}" attrs="{'invisible': [('composition_mode', '!=', 'mass')]}"/>
|
|
<field name="mass_keep_log" attrs="{'invisible': [('composition_mode', '!=', 'mass')]}"/>
|
|
</group>
|
|
</group>
|
|
</sheet>
|
|
<footer>
|
|
<button string="Send SMS" type="object" class="oe_highlight" name="action_send_sms"/>
|
|
<button string="Close" class="btn btn-secondary" special="cancel"/>
|
|
</footer>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="sms_composer_action_form" model="ir.actions.act_window">
|
|
<field name="name">Send SMS Text Message</field>
|
|
<field name="res_model">sms.composer</field>
|
|
<field name="view_mode">form</field>
|
|
<field name="target">new</field>
|
|
</record>
|
|
|
|
</odoo>
|