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

        <record model="ir.module.category" id="module_category_all_op_discuss">
            <field name="name">Timetable</field>
            <field name="description">Helps you manage your institutes different-different users.</field>
            <field name="sequence">113</field>
            <field name="parent_id" eval="False"/>
        </record>
        <record id="module_privilege_openeducat_timetable" model="res.groups.privilege">
            <field name="name">Timetable</field>
            <field name="category_id" ref="openeducat_timetable.module_category_all_op_discuss"/>
            <field name="sequence">16</field>
        </record>

        <record id="group_op_timetable_user" model="res.groups">
            <field name="name">User</field>
            <field name="privilege_id" ref="module_privilege_openeducat_timetable"/>
            <field name="user_ids" eval="[(4, ref('base.user_admin'))]"/>
            <field name="implied_ids"
                   eval="[(4, ref('base.group_user'))]"/>
        </record>

        <record id="group_op_timetable_manager" model="res.groups">
            <field name="name">Manager</field>
            <field name="privilege_id" ref="module_privilege_openeducat_timetable"/>
            <field name="user_ids" eval="[(4, ref('base.user_admin'))]"/>
            <field name="implied_ids"
                   eval="[(4, ref('openeducat_timetable.group_op_timetable_user'))]"/>
        </record>


        <record model="ir.rule" id="student_session_rule">
            <field name="name">Student Session rule</field>
            <field name="model_id" ref="model_op_session"/>
            <field name="groups"
                   eval="[(4, ref('openeducat_timetable.group_op_timetable_user'))]"/>
            <field name="domain_force">['|', ('user_ids','in',user.id), ('user_ids','in',user.child_ids.ids)]</field>
        </record>

        <record model="ir.rule" id="manager_session_rule">
            <field name="name">Manager Session Rule</field>
            <field name="model_id" ref="model_op_session"/>
            <field name="groups"
                   eval="[(4, ref('openeducat_timetable.group_op_timetable_manager'))]"/>
            <field name="domain_force">[(1,'=',1)]</field>
        </record>

        <record model="ir.rule" id="user_session_rule">
            <field name="name">User Session Rule</field>
            <field name="model_id" ref="model_op_session"/>
            <field name="groups"
                   eval="[(4, ref('openeducat_timetable.group_op_timetable_user'))]"/>
            <field name="domain_force">[('faculty_id.user_id','=',user.id)]</field>
        </record>

</odoo>
