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

    <record id="view_encoach_student_progress_form" model="ir.ui.view">
        <field name="name">encoach.student.progress.form</field>
        <field name="model">encoach.student.progress</field>
        <field name="arch" type="xml">
            <form string="Student Progress">
                <header>
                    <field name="status" widget="statusbar" statusbar_visible="not_started,in_progress,completed"/>
                </header>
                <sheet>
                    <group>
                        <group>
                            <field name="student_id"/>
                            <field name="course_id"/>
                            <field name="module_id"/>
                            <field name="resource_id"/>
                        </group>
                        <group>
                            <field name="score"/>
                            <field name="time_spent_minutes"/>
                            <field name="completed_at"/>
                            <field name="entity_id"/>
                        </group>
                    </group>
                </sheet>
            </form>
        </field>
    </record>

    <record id="view_encoach_student_progress_list" model="ir.ui.view">
        <field name="name">encoach.student.progress.list</field>
        <field name="model">encoach.student.progress</field>
        <field name="arch" type="xml">
            <list string="Student Progress">
                <field name="student_id"/>
                <field name="course_id"/>
                <field name="module_id"/>
                <field name="resource_id"/>
                <field name="status" widget="badge" decoration-info="status == 'in_progress'" decoration-success="status == 'completed'" decoration-warning="status == 'skipped'"/>
                <field name="score"/>
                <field name="time_spent_minutes"/>
                <field name="completed_at"/>
            </list>
        </field>
    </record>

    <record id="view_encoach_student_progress_search" model="ir.ui.view">
        <field name="name">encoach.student.progress.search</field>
        <field name="model">encoach.student.progress</field>
        <field name="arch" type="xml">
            <search string="Search Progress">
                <field name="student_id"/>
                <field name="course_id"/>
                <filter string="Completed" name="completed" domain="[('status', '=', 'completed')]"/>
                <filter string="In Progress" name="in_progress" domain="[('status', '=', 'in_progress')]"/>
                <separator/>
                <filter string="Student" name="group_student" context="{'group_by': 'student_id'}"/>
                <filter string="Course" name="group_course" context="{'group_by': 'course_id'}"/>
                <filter string="Status" name="group_status" context="{'group_by': 'status'}"/>
            </search>
        </field>
    </record>

    <record id="action_encoach_student_progress" model="ir.actions.act_window">
        <field name="name">Student Progress</field>
        <field name="res_model">encoach.student.progress</field>
        <field name="view_mode">list,form</field>
    </record>

</odoo>
