<?xml version="1.0" encoding="UTF-8"?>
<odoo>
        <record id="view_op_activity_tree" model="ir.ui.view">
            <field name="name">op.activity.list</field>
            <field name="model">op.activity</field>
            <field name="priority" eval="8"/>
            <field name="arch" type="xml">
                <list string="Activity Log">
                    <field name="student_id"/>
                    <field name="faculty_id"/>
                    <field name="type_id"/>
                    <field name="date"/>
                    <field name="description" optional="hide"/>
                </list>
            </field>
        </record>

        <record id="view_op_activity_form" model="ir.ui.view">
            <field name="name">op.activity.form</field>
            <field name="model">op.activity</field>
            <field name="priority" eval="8"/>
            <field name="arch" type="xml">
                <form string="Activity Log">
                    <header/>
                    <sheet>
                        <field name="active" invisible="True"/>
                        <widget name="web_ribbon" title="Archived" bg_color="bg-danger"
                                invisible="active == True"/>
                        <group>
                            <group>
                                <field name="student_id"/>
                                <field name="faculty_id"/>
                            </group>
                            <group>
                                <field name="type_id"/>
                                <field name="date"/>
                            </group>
                        </group>
                        <div>
                            <label for="description" string="Description" class="mt32"/>
                            <field name="description" nolabel="1"/>
                        </div>
                    </sheet>
                    <chatter/>
                </form>
            </field>
        </record>

        <record id="view_op_activity_search" model="ir.ui.view">
            <field name="name">op.activity.search</field>
            <field name="model">op.activity</field>
            <field name="priority" eval="8"/>
            <field name="arch" type="xml">
                <search string="Activity Log">
                    <field name="student_id"/>
                    <field name="faculty_id"/>
                    <field name="type_id"/>
                    <field name="date"/>
                    <filter string="Archived" name="inactive"
                            domain="[('active', '=', False)]"/>
                </search>
            </field>
        </record>

        <record id="view_op_activity_pivot" model="ir.ui.view">
            <field name="name">op.activity.pivot</field>
            <field name="model">op.activity</field>
            <field name="priority" eval="8"/>
            <field name="arch" type="xml">
                <pivot string="Activity Pivot">
                    <field name="student_id" type="row"/>
                    <field name="type_id" type="col"/>
                </pivot>
            </field>
        </record>

        <record model="ir.ui.view" id="view_op_activity_graph">
            <field name="name">op.acitviy.graph</field>
            <field name="model">op.activity</field>
            <field name="arch" type="xml">
                <graph string="Activity Graph View" type="bar">
                    <field name="student_id"/>
                    <field name="type_id"/>
                </graph>
            </field>
        </record>

        <record model="ir.actions.act_window" id="act_open_op_activity_view">
            <field name="name">Activity Logs</field>
            <field name="path">activity</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">op.activity</field>
            <field name="binding_view_types">form</field>
            <field name="view_mode">list,form,pivot,graph</field>
            <field name="search_view_id" ref="view_op_activity_search"/>
        </record>

        <record model="ir.actions.act_window.view" id="act_open_op_activity_view_form">
            <field name="act_window_id" ref="act_open_op_activity_view"/>
            <field name="sequence" eval="20"/>
            <field name="view_mode">form</field>
            <field name="view_id" ref="view_op_activity_form"/>
        </record>

        <record model="ir.actions.act_window.view" id="act_open_op_activity_view_tree">
            <field name="act_window_id" ref="act_open_op_activity_view"/>
            <field name="sequence" eval="10"/>
            <field name="view_mode">list</field>
            <field name="view_id" ref="view_op_activity_tree"/>
        </record>
</odoo>
