<?xml version="1.0"?>
<odoo>
    <record id="event_event_view_form_inherit_mass_mailing" model="ir.ui.view">
        <field name="name">event.event.view.form.inherit.mass.mailing</field>
        <field name="model">event.event</field>
        <field name="priority" eval="4"/>
        <field name="inherit_id" ref="event.view_event_form"/>
        <field name="arch" type="xml">
            <xpath expr="//field[@name='stage_id']" position="before">
                <field name="event_registrations_open" invisible="1"/>
                <button name="action_invite_contacts" type="object" string="Invite"
                    class="btn btn-primary"
                    groups="mass_mailing.group_mass_mailing_user"
                    invisible="not event_registrations_open"/>
                <button name="action_invite_contacts" type="object" string="Invite"
                    class="btn btn-secondary"
                    groups="mass_mailing.group_mass_mailing_user"
                    invisible="event_registrations_open"/>
                <button name="action_mass_mailing_attendees" type="object" string="Contact Attendees"
                    groups="mass_mailing.group_mass_mailing_user"
                    invisible="seats_taken == 0"/>
            </xpath>
        </field>
    </record>
</odoo>
