<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="mailing_list_view_kanban" model="ir.ui.view">
        <field name="name">mailing.list.view.kanban.inherit.mass.mailing.sms</field>
        <field name="model">mailing.list</field>
        <field name="inherit_id" ref="mass_mailing.mailing_list_view_kanban"/>
        <field name="arch" type="xml">
            <xpath expr="//div[hasclass('o_mailing_list_kanban_stats')]//a" position="after">
                <a class="me-sm-0 me-3 fs-4 fw-light lh-1" tabindex="-1"
                    name="action_view_contacts_sms" type="object">
                    <field name="contact_count_sms" class="fw-normal"/>
                    <br/>
                    <span class="text-muted">
                        <i class="fa fa-phone"/> Contacts
                    </span>
                </a>
            </xpath>
        </field>
    </record>

    <record id="mailing_list_view_form" model="ir.ui.view">
        <field name="name">mailing.list.view.form.inherit.sms</field>
        <field name="model">mailing.list</field>
        <field name="inherit_id" ref="mass_mailing.mailing_list_view_form"/>
        <field name="arch" type="xml">
            <xpath expr="//button[@name='action_send_mailing']" position="after">
                <button name="action_send_mailing_sms" string="Send SMS"
                        type="object" class="btn btn-primary"/>
            </xpath>
        </field>
    </record>

    <record id="mailing_list_action_sms" model="ir.actions.act_window">
        <field name="name">Mailing Lists</field>
        <field name="res_model">mailing.list</field>
        <field name="view_mode">kanban,list,form</field>
        <field name="context">{'mailing_sms': True}</field>
        <field name="help" type="html">
          <p class="o_view_nocontent_smiling_face">
            Create a Mailing List
          </p><p>
            No need to import mailing lists, you can send SMS to contacts saved in other Odoo apps.
          </p>
        </field>
    </record>
</odoo>
