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

    <record id="view_encoach_course_section_form" model="ir.ui.view">
        <field name="name">encoach.course.section.form</field>
        <field name="model">encoach.course.section</field>
        <field name="arch" type="xml">
            <form string="Course Section">
                <sheet>
                    <group>
                        <group>
                            <field name="name"/>
                            <field name="course_id"/>
                            <field name="skill"/>
                            <field name="sequence"/>
                        </group>
                    </group>
                    <notebook>
                        <page string="Modules">
                            <field name="module_ids">
                                <list>
                                    <field name="name"/>
                                    <field name="cefr_target"/>
                                    <field name="status" widget="badge" decoration-info="status == 'available'" decoration-success="status == 'completed'" decoration-warning="status == 'in_progress'"/>
                                    <field name="sequence"/>
                                </list>
                            </field>
                        </page>
                    </notebook>
                </sheet>
            </form>
        </field>
    </record>

    <record id="view_encoach_course_section_list" model="ir.ui.view">
        <field name="name">encoach.course.section.list</field>
        <field name="model">encoach.course.section</field>
        <field name="arch" type="xml">
            <list string="Course Sections">
                <field name="sequence" widget="handle"/>
                <field name="name"/>
                <field name="course_id"/>
                <field name="skill" widget="badge"/>
            </list>
        </field>
    </record>

    <record id="view_encoach_course_section_search" model="ir.ui.view">
        <field name="name">encoach.course.section.search</field>
        <field name="model">encoach.course.section</field>
        <field name="arch" type="xml">
            <search string="Search Sections">
                <field name="name"/>
                <field name="course_id"/>
                <separator/>
                <filter string="Course" name="group_course" context="{'group_by': 'course_id'}"/>
                <filter string="Skill" name="group_skill" context="{'group_by': 'skill'}"/>
            </search>
        </field>
    </record>

    <record id="action_encoach_course_section" model="ir.actions.act_window">
        <field name="name">Course Sections</field>
        <field name="res_model">encoach.course.section</field>
        <field name="view_mode">list,form</field>
    </record>

</odoo>
