<?xml version="1.0"?>
<odoo>
    <record id="slide_channel_view_form" model="ir.ui.view">
        <field name="name">slide.channel.view.form.inherit.mass.mailing</field>
        <field name="model">slide.channel</field>
        <field name="inherit_id" ref="website_slides.view_slide_channel_form"/>
        <field name="arch" type="xml">
            <button name="action_channel_enroll" position="before">
                <field name="members_count" invisible="1"/>
                <button name="action_mass_mailing_attendees" string="Contact Attendees" type="object"
                        class="oe_highlight" invisible="members_count == 0"
                        groups="mass_mailing.group_mass_mailing_user"/>
            </button>
        </field>
    </record>

    <record id="slide_channel_view_kanban" model="ir.ui.view">
        <field name="name">slide.channel.view.kanban.inherit.mass.mailing</field>
        <field name="model">slide.channel</field>
        <field name="inherit_id" ref="website_slides.slide_channel_view_kanban"/>
        <field name="arch" type="xml">
            <xpath expr="//a[@name='action_channel_invite']" position="after">
                <a role="menuitem" name="action_mass_mailing_attendees" type="object"
                   groups="mass_mailing.group_mass_mailing_user" class="dropdown-item">
                    Contact Attendees
                </a>
            </xpath>
        </field>
    </record>
</odoo>
