<?xml version="1.0" encoding="utf-8"?>
<odoo>

    <record id="view_adaptive_event_form" model="ir.ui.view">
        <field name="name">encoach.adaptive.event.form</field>
        <field name="model">encoach.adaptive.event</field>
        <field name="arch" type="xml">
            <form string="Adaptive Event">
                <sheet>
                    <group>
                        <group>
                            <field name="student_id"/>
                            <field name="course_id"/>
                            <field name="event_type"/>
                        </group>
                        <group>
                            <field name="signal_name"/>
                            <field name="signal_value"/>
                            <field name="decision"/>
                            <field name="created_at"/>
                        </group>
                    </group>
                    <group>
                        <field name="context"/>
                    </group>
                </sheet>
            </form>
        </field>
    </record>

    <record id="view_adaptive_event_list" model="ir.ui.view">
        <field name="name">encoach.adaptive.event.list</field>
        <field name="model">encoach.adaptive.event</field>
        <field name="arch" type="xml">
            <list string="Adaptive Events">
                <field name="student_id"/>
                <field name="event_type" widget="badge"/>
                <field name="signal_name"/>
                <field name="signal_value"/>
                <field name="decision"/>
                <field name="created_at"/>
            </list>
        </field>
    </record>

    <record id="view_adaptive_event_search" model="ir.ui.view">
        <field name="name">encoach.adaptive.event.search</field>
        <field name="model">encoach.adaptive.event</field>
        <field name="arch" type="xml">
            <search string="Search Adaptive Events">
                <field name="student_id"/>
                <separator/>
                <filter string="Signals" name="signal" domain="[('event_type', '=', 'signal')]"/>
                <filter string="Decisions" name="decision" domain="[('event_type', '=', 'decision')]"/>
                <separator/>
                <filter string="Student" name="group_student" context="{'group_by': 'student_id'}"/>
            </search>
        </field>
    </record>

    <record id="action_adaptive_event" model="ir.actions.act_window">
        <field name="name">Adaptive Events</field>
        <field name="res_model">encoach.adaptive.event</field>
        <field name="view_mode">list,form</field>
    </record>

</odoo>
