<?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_invite" position="after">
                <field name="members_count" invisible="1"/>
                <button name="action_mass_mailing_attendees" string="Contact Attendees" type="object"
                        class="oe_highlight" attrs="{'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="//div[@name='action_channel_invite']" position="after">
                <div role="menuitem">
                    <a name="action_mass_mailing_attendees" type="object"
                       groups="mass_mailing.group_mass_mailing_user" class="float-start pe-1">
                        Contact Attendees
                    </a>
                </div>
            </xpath>
        </field>
    </record>
</odoo>
