<?xml version="1.0" ?>
<odoo>
    <record id="view_event_registration_form" model="ir.ui.view">
        <field name="model">event.registration</field>
        <field name="inherit_id" ref="event.view_event_registration_form" />
        <field name="arch" type="xml">
            <field name="event_id" position="after">
                <field name="use_sessions" invisible="1" />
                <field
                    name="session_id"
                    domain="[('event_id', '=', event_id)]"
                    attrs="{'required': [('use_sessions', '=', True)], 'invisible': [('use_sessions', '!=', True)]}"
                    options="{'no_create': True}"
                />
            </field>
        </field>
    </record>
    <record id="view_event_registration_tree" model="ir.ui.view">
        <field name="model">event.registration</field>
        <field name="inherit_id" ref="event.view_event_registration_tree" />
        <field name="arch" type="xml">
            <field name="event_id" position="after">
                <field name="session_id" optional="show" />
            </field>
        </field>
    </record>
    <record id="event_registration_view_kanban" model="ir.ui.view">
        <field name="model">event.registration</field>
        <field name="inherit_id" ref="event.event_registration_view_kanban" />
        <field name="arch" type="xml">
            <field name="event_id" position="after">
                <field name="use_sessions" invisible="1" />
                <field
                    name="session_id"
                    class="o_text_overflow"
                    invisible="context.get('default_session_id')"
                    attrs="{'required': [('use_sessions', '=', True)], 'invisible': [('use_sessions', '!=', True)]}"
                />
            </field>
        </field>
    </record>
    <record id="view_event_registration_calendar" model="ir.ui.view">
        <field name="model">event.registration</field>
        <field name="inherit_id" ref="event.view_event_registration_calendar" />
        <field name="arch" type="xml">
            <field name="event_id" position="after">
                <field name="session_id" filters="1" />
            </field>
        </field>
    </record>
    <record model="ir.ui.view" id="view_event_registration_pivot">
        <field name="model">event.registration</field>
        <field name="inherit_id" ref="event.view_event_registration_pivot" />
        <field name="arch" type="xml">
            <field name="event_id" position="after">
                <field name="session_id" type="row" />
            </field>
        </field>
    </record>
    <record model="ir.ui.view" id="view_event_registration_graph">
        <field name="model">event.registration</field>
        <field name="inherit_id" ref="event.view_event_registration_graph" />
        <field name="arch" type="xml">
            <field name="event_id" position="after">
                <field name="session_id" />
            </field>
        </field>
    </record>
    <record model="ir.ui.view" id="view_registration_search">
        <field name="model">event.registration</field>
        <field name="inherit_id" ref="event.view_registration_search" />
        <field name="arch" type="xml">
            <field name="event_id" position="after">
                <field name="session_id" />
            </field>
        </field>
    </record>
</odoo>
