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

        <record model="ir.module.category" id="module_category_all_op_exam">
            <field name="name">Exam</field>
            <field name="description">Helps you manage your institutes different-different users.</field>
            <field name="sequence">108</field>
            <field name="parent_id" eval="False"/>
        </record>
        <record id="module_category_openeducat_exam" model="res.groups.privilege">
            <field name="name">Exam</field>
            <field name="description">Helps you manage your institutes different-different users.</field>
            <field name="category_id" ref="openeducat_exam.module_category_all_op_exam"/>
            <field name="sequence">18</field>
        </record>

        <record id="group_op_exam_user" model="res.groups">
            <field name="name">User</field>
            <field name="privilege_id" ref="module_category_openeducat_exam"/>
            <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_exam_admin" model="res.groups">
            <field name="name">Manager</field>
            <field name="privilege_id" ref="module_category_openeducat_exam"/>
            <field name="user_ids" eval="[(4, ref('base.user_admin'))]"/>
            <field name="implied_ids"
                   eval="[(4, ref('openeducat_exam.group_op_exam_user'))]"/>
        </record>
        <record model="ir.rule" id="student_marksheet_rule">
            <field name="name">Student Marksheet</field>
            <field name="model_id" ref="model_op_marksheet_line"/>
            <field name="groups"
                   eval="[(4, ref('openeducat_exam.group_op_exam_admin'))]"/>
            <field name="domain_force">['|', ('student_id.user_id','=',user.id),
                ('student_id.user_id','in',user.child_ids.ids)]
            </field>
        </record>

        <record model="ir.rule" id="admin_marksheet_rule">
            <field name="name">Admin Marksheet</field>
            <field name="model_id" ref="model_op_marksheet_line"/>
            <field name="groups"
                   eval="[(4, ref('openeducat_exam.group_op_exam_admin'))]"/>
            <field name="domain_force">[(1,"=",1)]</field>
        </record>

        <record model="ir.rule" id="student_result_rule">
            <field name="name">Student Result Line</field>
            <field name="model_id" ref="model_op_result_line"/>
            <field name="groups"
                   eval="[(4, ref('openeducat_exam.group_op_exam_admin'))]"/>
            <field name="domain_force">['|', ('student_id.user_id','=',user.id),
                ('student_id.user_id','in',user.child_ids.ids)]
            </field>
        </record>

        <record model="ir.rule" id="admin_result_rule">
            <field name="name">Admin Result Line</field>
            <field name="model_id" ref="model_op_result_line"/>
            <field name="groups"
                   eval="[(4, ref('openeducat_exam.group_op_exam_admin'))]"/>
            <field name="domain_force">[(1,'=',1)]</field>
        </record>

</odoo>
