Files
odoo_source/addons/sms/views/sms_sms_views.xml
T
Florian Charlier e8878a8b4c [IMP] {mass_mailing_,}sms: delay sms deletion
Also impacts test_mail_sms.

Purpose: let a cron do delete records to end the
sending transaction sooner.

Removing the foreign key between sms_sms and mailing_trace
is necessary as traces may have to be updated due to
delivery reports.
This is why we do it here and not with notifications
because only traces will trigger updates of a possibly
massive number of records and repeated concurrent updates.

We also replace the now obsolete "sms_sms_X" prefix as there
are not many "sms_id" to distinguish from.

Task-2560666

Part-of: odoo/odoo#133392
2023-10-24 12:38:13 +00:00

84 lines
3.9 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<odoo><data>
<record id="sms_tsms_view_form" model="ir.ui.view">
<field name="name">sms.sms.view.form</field>
<field name="model">sms.sms</field>
<field name="arch" type="xml">
<form string="SMS">
<header>
<field name="to_delete" invisible="1"/>
<button name="send" string="Send Now" type="object" invisible="state != 'outgoing' or to_delete" class="oe_highlight"/>
<button name="action_set_outgoing" string="Retry" type="object" invisible="state not in ('error', 'canceled')"/>
<button name="action_set_canceled" string="Cancel" type="object" invisible="state not in ('error', 'outgoing')"/>
<field name="state" widget="statusbar" statusbar_visible="outgoing,sent,error,canceled"/>
</header>
<sheet>
<group>
<group>
<field name="partner_id" string="Contact"/>
<field name="mail_message_id" readonly="1" invisible="not mail_message_id"/>
</group>
<group>
<field name="number" required="1"/>
<field name="failure_type" readonly="1" invisible="not failure_type"/>
</group>
</group>
<group>
<field name="body" widget="sms_widget" string="Message" required="1"
readonly="state in ('process', 'sent')"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="sms_sms_view_tree" model="ir.ui.view">
<field name="name">sms.sms.view.tree</field>
<field name="model">sms.sms</field>
<field name="arch" type="xml">
<tree string="SMS Templates">
<field name="number"/>
<field name="partner_id"/>
<field name="failure_type"/>
<field name="state" widget="badge" decoration-info="state == 'outgoing'" decoration-muted="state == 'canceled'" decoration-success="state == 'sent'" decoration-danger="state == 'error'"/>
<button name="send" string="Send Now" type="object" icon="fa-paper-plane" invisible="state != 'outgoing'"/>
<button name="action_set_outgoing" string="Retry" type="object" icon="fa-repeat" invisible="state not in ('error', 'canceled')"/>
<button name="action_set_canceled" string="Cancel" type="object" icon="fa-times-circle" invisible="state not in ('error', 'outgoing')"/>
</tree>
</field>
</record>
<record id="sms_sms_view_search" model="ir.ui.view">
<field name="name">sms.sms.view.search</field>
<field name="model">sms.sms</field>
<field name="arch" type="xml">
<search string="Search SMS Templates">
<field name="number"/>
<field name="partner_id"/>
</search>
</field>
</record>
<record id="sms_sms_action" model="ir.actions.act_window">
<field name="name">SMS</field>
<field name="res_model">sms.sms</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('to_delete', '!=', True)]</field>
</record>
<menuitem id="sms_sms_menu"
parent="phone_validation.phone_menu_main"
action="sms_sms_action"
sequence="1"/>
<record id="ir_actions_server_sms_sms_resend" model="ir.actions.server">
<field name="name">Resend</field>
<field name="model_id" ref="sms.model_sms_sms"/>
<field name="binding_model_id" ref="sms.model_sms_sms"/>
<field name="binding_view_types">list</field>
<field name="state">code</field>
<field name="code">action = records.resend_failed()</field>
</record>
</data>
</odoo>