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

        <record model="ir.module.category" id="module_category_all_parent">
            <field name="name">Parent</field>
            <field name="description">Helps you manage your institutes different-different users.</field>
            <field name="sequence">107</field>
            <field name="parent_id" eval="False"/>
        </record>
        <record id="module_privilege_openeducat_parent" model="res.groups.privilege">
            <field name="name">Parent</field>
            <field name="description">Helps you manage your institutes different-different users.</field>
            <field name="category_id" ref="module_category_all_parent"/>
            <field name="sequence">18</field>
        </record>

        <record id="group_op_parent_manager" model="res.groups">
            <field name="name">Manager</field>
            <field name="privilege_id" ref="module_privilege_openeducat_parent"/>
            <field name="user_ids" eval="[(4, ref('base.user_admin'))]"/>
        </record>
        <record model="ir.rule" id="parent_login_rule">
            <field name="name">Parent Login rule</field>
            <field name="model_id" ref="model_op_parent"/>
            <field name="groups" eval="[(4, ref('base.group_portal'))]"/>
            <field name="domain_force">['|', ('user_id','=',user.id), ('user_id','in',user.child_ids.ids)]</field>
        </record>

        <record model="ir.rule" id="backoffice_login_rule">
            <field name="name">Backoffice Login rule</field>
            <field name="model_id" ref="model_op_parent"/>
            <field name="groups" eval="[(4, ref('openeducat_parent.group_op_parent_manager'))]"/>
            <field name="domain_force">[(1,'=',1)]</field>
        </record>

        <record model="ir.rule" id="student_parent_login_rule">
            <field name="name">Student Parent Login rule</field>
            <field name="model_id" ref="model_op_student"/>
            <field name="groups" eval="[(4, ref('base.group_portal'))]"/>
            <field name="domain_force">['|', ('user_id','=',user.id), ('user_id','in',user.child_ids.ids)]</field>
        </record>

</odoo>
