<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="0">

    <record model="res.groups" id="group_partner_manager" context="{'noadmin':True}">
        <field name="name">Partner Manager</field>
    </record>

    <record model="ir.ui.menu" id="menu_config_address_book">
        <field eval="[(6,0,[ref('group_system'), ref('group_partner_manager')])]" name="groups_id"/>
    </record>
    <record model="ir.ui.menu" id="menu_base_config">
        <field eval="[(6,0,[ref('group_system'), ref('group_partner_manager')])]" name="groups_id"/>
    </record>
    <record model="ir.ui.menu" id="menu_base_partner">
        <field eval="[(6,0,[ref('group_partner_manager')])]" name="groups_id"/>
    </record>

</data>

<data noupdate="1">

    <!-- Record Rule For Company -->

    <record id="res_company_rule" model="ir.rule">
        <field name="name">company rule</field>
        <field model="ir.model" name="model_id" ref="model_res_company"/>
        <field eval="True" name="global"/>
        <!-- TODO: review this <field name="domain_force">['|', ('child_ids', 'child_of', [user.company_id.id]), ('parent_id', 'child_of', [user.company_id.id])]</field> -->
        <field name="domain_force">[('id','child_of',[user.company_id.id])]</field>
    </record>

    <!-- Record Rule For User -->
    <record id="res_users_rule" model="ir.rule">
        <field name="name">user rule</field>
        <field model="ir.model" name="model_id" ref="model_res_users"/>
        <field eval="True" name="global"/>
        <field name="domain_force">['|',('company_id.child_ids','child_of',[user.company_id.id]),('company_id','child_of',[user.company_id.id])]</field>
    </record>
    
</data>
</openerp>
