<?xml version="1.0" encoding="utf-8"?>
<odoo>
        <record model="ir.module.category" id="module_category_all_op_activity">
            <field name="name">Activity</field>
            <field name="description">Helps you manage your institutes different-different users.</field>
            <field name="sequence">101</field>
            <field name="parent_id" eval="False"/>
        </record>
        <record id="module_category_openeducat_activity" model="ir.module.category">
            <field name="name">Activity</field>
            <field name="description">Helps you manage your institutes different-different users.</field>
            <field name="parent_id" ref="openeducat_activity.module_category_all_op_activity"/>
            <field name="sequence">1</field>
        </record>

        <record id="module_activity_privilege" model="res.groups.privilege">
            <field name="name">Openeducat Activity Privilege</field>
            <field name="category_id" ref="module_category_openeducat_activity"/>
        </record>

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

        <record id="group_activity_manager" model="res.groups">
            <field name="name">Manager</field>
            <field name="privilege_id" ref="module_activity_privilege"/>
            <field name="user_ids" eval="[(4, ref('base.user_admin'))]"/>
            <field name="implied_ids"
                   eval="[(4, ref('openeducat_activity.group_activity_user'))]"/>
        </record>
        <record model="ir.rule" id="student_activity_log_rule">
            <field name="name">Student Activity Logs</field>
            <field name="model_id" ref="model_op_activity"/>
            <field name="groups"
                   eval="[(4, ref('openeducat_activity.group_activity_manager'))]"/>
            <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="faculty_activity_log_rule">
            <field name="name">Faculty Activity Logs</field>
            <field name="model_id" ref="model_op_activity"/>
            <field name="groups"
                   eval="[(4, ref('openeducat_activity.group_activity_user'))]"/>
            <field name="domain_force">['|', ('faculty_id.user_id','=',user.id), ('faculty_id.user_id','in',user.child_ids.ids)]
            </field>
        </record>

        <record model="ir.rule" id="back_office_activity_log_rule">
            <field name="name">Back Office Activity Logs</field>
            <field name="model_id" ref="model_op_activity"/>
            <field name="groups"
                   eval="[(4, ref('openeducat_activity.group_activity_manager'))]"/>
            <field name="domain_force">[(1,'=',1)]</field>
        </record>
</odoo>
