<?xml version="1.0" encoding="utf-8"?>
<odoo>
        <record model="ir.module.category" id="module_category_all_op_attendance">
            <field name="name">Attendance</field>
            <field name="description">Helps you manage your institutes different-different users.</field>
            <field name="sequence">106</field>
            <field name="parent_id" eval="False"/>
        </record>
        <record id="module_category_openeducat_attendance" model="res.groups.privilege">
            <field name="name">Attendance</field>
            <field name="category_id" ref="openeducat_attendance.module_category_all_op_attendance"/>
            <field name="sequence">17</field>
        </record>

        <record id="group_op_attendance_user" model="res.groups">
            <field name="name">User</field>
            <field name="privilege_id" ref="module_category_openeducat_attendance"/>
            <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_attendance_manager" model="res.groups">
            <field name="name">Manager</field>
            <field name="privilege_id" ref="module_category_openeducat_attendance"/>
            <field name="user_ids" eval="[(4, ref('base.user_admin'))]"/>
            <field name="implied_ids"
                   eval="[(4, ref('openeducat_attendance.group_op_attendance_user'))]"/>
        </record>

        <record model="ir.rule" id="student_activity_log_rule">
            <field name="name">Student Attendance</field>
            <field name="model_id" ref="model_op_attendance_line"/>
            <field name="groups"
                   eval="[(4, ref('openeducat_attendance.group_op_attendance_manager'))]"/>
            <field name="domain_force">['|', ('student_id.user_id','=',user.id),
                ('student_id.user_id','in',user.child_ids.ids)]
            </field>
        </record>

        <record id="rule_faculty_attendance_line" model="ir.rule">
            <field name="name">User Attendance</field>
            <field name="model_id" ref="model_op_attendance_line"/>
            <field name="groups" eval="[(4, ref('openeducat_attendance.group_op_attendance_user'))]"/>
            <field name="domain_force">[(1, '=', 1)]</field>
        </record>

        <record model="ir.rule" id="attendance_type_multi_comp_rule">
            <field name="name">attendance type multi comp rule</field>
            <field name="model_id" ref="openeducat_attendance.model_op_attendance_type"/>
            <field name="global" eval="True"/>
            <field name="domain_force">['|','|',('company_id','=',False),('company_id','child_of',[user.company_id.id]),('company_id','in',user.company_ids.ids),('company_id','in', company_ids)]</field>
        </record>
</odoo>
