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

        <record id="view_op_result_line_tree" model="ir.ui.view">
            <field name="name">op.result.line.list</field>
            <field name="model">op.result.line</field>
            <field name="priority" eval="8"/>
            <field name="arch" type="xml">
                <list string="Result Line">
                    <field name="student_id"/>
                    <field name="exam_id"/>
                    <field name="marks"/>
                    <field name="grade" invisible="evaluation_type != 'grade'"/>
                    <field name="status"/>
                    <field name="evaluation_type" />
                </list>
            </field>
        </record>

        <record id="view_op_result_line_form" model="ir.ui.view">
            <field name="name">op.result.line.form</field>
            <field name="model">op.result.line</field>
            <field name="priority" eval="8"/>
            <field name="arch" type="xml">
                <form string="Result Line">
                    <header/>
                    <sheet>
                        <group>
                            <group>
                                <field name="student_id"/>
                                <field name="marks"/>
                                <field name="grade" invisible="evaluation_type != 'grade'"/>
                                <field name="marksheet_line_id" invisible="1"/>
                            </group>
                            <group>
                                <field name="exam_id"/>
                                <field name="status"/>
                                <field name="evaluation_type" />
                            </group>
                        </group>
                    </sheet>
                </form>
            </field>
        </record>

        <record id="view_op_result_line_search" model="ir.ui.view">
            <field name="name">op.result.line.search</field>
            <field name="model">op.result.line</field>
            <field name="priority" eval="8"/>
            <field name="arch" type="xml">
                <search string="Result Line">
                    <field name="marksheet_line_id"/>
                    <field name="exam_id"/>
                    <field name="marks"/>
                    <newline/>
                    <group>
                        <filter string="Marksheet Line" name="group_by_result_line_marksheet_line"
                                domain="[]" context="{'group_by':'marksheet_line_id'}"/>
                        <filter string="Exam" name="group_by_result_line_exam"
                                domain="[]" context="{'group_by':'exam_id'}"/>
                        <filter string="Marks" name="group_by_result_line_marks"
                                domain="[]" context="{'group_by':'marks'}"/>
                        <filter string="Students" name="group_by_result_line_student"
                                domain="[]" context="{'group_by':'student_id'}"/>
                        <filter string="Status" name="group_by_result_line_status"
                                domain="[]" context="{'group_by':'status'}"/>
                    </group>
                </search>
            </field>
        </record>

        <record model="ir.ui.view" id="view_op_result_line_graph_view">
            <field name="name">op.result.line.graph</field>
            <field name="model">op.result.line</field>
            <field name="arch" type="xml">
                <graph string="Result Analysis (Session / Exam)" type="bar" stacked="0">
                    <field name="session_id" type="row"/>
                    <field name="exam_id" type="row"/>
                    <field name="status" type="col"/>
                    <field name="id" type="measure" operator="count" string="Count"/>
                </graph>
            </field>
        </record>
        <record model="ir.actions.act_window" id="act_open_op_result_line_view">
            <field name="name">Result Lines</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">op.result.line</field>
            <field name="path">result-line</field>
            <field name="binding_view_types">form</field>
            <field name="view_mode">list,form</field>
            <field name="search_view_id" ref="view_op_result_line_search"/>
            <field name="domain">[]</field>
            <field name="context">{}</field>
        </record>

        <record model="ir.actions.act_window.view" id="act_open_op_result_line_view_form">
            <field name="act_window_id" ref="act_open_op_result_line_view"/>
            <field name="sequence" eval="20"/>
            <field name="view_mode">form</field>
            <field name="view_id" ref="view_op_result_line_form"/>
        </record>

        <record model="ir.actions.act_window.view" id="act_open_op_result_line_view_tree">
            <field name="act_window_id" ref="act_open_op_result_line_view"/>
            <field name="sequence" eval="10"/>
            <field name="view_mode">list</field>
            <field name="view_id" ref="view_op_result_line_tree"/>
        </record>

        <record id="act_open_op_result_line_view_graph" model="ir.actions.act_window">
        <field name="name">Result Analysis</field>
        <field name="res_model">op.result.line</field>
        <field name="path">result-analysis</field>
        <field name="view_mode">graph</field>
        <field name="view_id" ref="view_op_result_line_graph_view"/>
    </record>

</odoo>
