<?xml version="1.0" encoding="UTF-8"?>
<odoo>
        <record id="view_op_student_course_tree" model="ir.ui.view">
            <field name="name">op.student.course.list</field>
            <field name="model">op.student.course</field>
            <field name="priority" eval="8"/>
            <field name="arch" type="xml">
                <list string="Student Course Detail">
                    <field name="student_id"/>
                    <field name="course_id"/>
                    <field name="batch_id"/>
                    <field name="subject_ids" widget="many2many_tags"/>
                    <field name="roll_number"/>
                    <field name="academic_years_id" optional="hide"/>
                    <field name="academic_term_id" optional="hide"/>
                    <field name="state"/>
                </list>
            </field>
        </record>

        <record id="view_op_student_course_form" model="ir.ui.view">
            <field name="name">op.student.course.form</field>
            <field name="model">op.student.course</field>
            <field name="priority" eval="8"/>
            <field name="arch" type="xml">
                <form string="Student Course Detail">
                    <header>
                            <field name="state" widget="statusbar"/>
                    </header>
                    <sheet>
                        <group>
                            <group>
                                <field name="student_id"/>
                                <field name="batch_id" domain="[('course_id', '=', course_id)]" required="1"/>
                                <field name="academic_years_id"/>
                            </group>
                            <group>
                                <field name="course_id"/>
                                <field name="roll_number"/>
                                <field name="academic_term_id"/>
                            </group>
                        </group>
                        <notebook>
                            <page string="Subjects" name="subjects">
                                <field name="subject_ids" nolabel="1"/>
                            </page>
                        </notebook>
                    </sheet>
                    <chatter/>
                </form>
            </field>
        </record>

        <record id="view_op_student_course_search" model="ir.ui.view">
            <field name="name">op.student.course.search</field>
            <field name="model">op.student.course</field>
            <field name="priority" eval="8"/>
            <field name="arch" type="xml">
                <search string="Student Course">
                    <field name="student_id"/>
                    <field name="course_id"/>
                    <field name="batch_id"/>
                    <field name="roll_number"/>
                    <newline/>
                    <group>
                        <filter string="Course" name="group_by_adm_course_id"
                                domain="[]" context="{'group_by':'course_id'}"/>
                        <filter string="Batch" name="group_by_adm_batch_id"
                                domain="[]" context="{'group_by':'batch_id'}"/>
                        <filter string="Academic Year" name="group_by_adm_academic_years_id"
                                domain="[]" context="{'group_by':'academic_years_id'}"/>
                        <filter string="Academic Term" name="group_by_adm_academic_term_id"
                                domain="[]" context="{'group_by':'academic_term_id'}"/>
                    </group>
                </search>
            </field>
        </record>


        <record id="view_op_student_course_pivot" model="ir.ui.view">
            <field name="name">op.student.course.pivot</field>
            <field name="model">op.student.course</field>
            <field name="priority" eval="8"/>
            <field name="arch" type="xml">
                <pivot string="Student Course">
                    <field name="student_id"/>
                    <field name="course_id" type="row"/>
                    <field name="batch_id"/>
                </pivot>
            </field>
        </record>

        <record model="ir.actions.act_window" id="act_open_op_student_course_view">
            <field name="name">Student Course Detail</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">op.student.course</field>
            <field name="path">student-course</field>
            <field name="binding_view_types">form</field>
            <field name="view_mode">list,form,pivot</field>
            <field name="search_view_id" ref="view_op_student_course_search"/>

        </record>
</odoo>
