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

        <record model="ir.module.category" id="module_category_event_management">
            <field name="name">Events</field>
            <field name="description">Helps you manage your Events.</field>
            <field name="sequence">3</field>
        </record>

        <record id="group_event_user" model="res.groups">
            <field name="name">User</field>
            <field name="category_id" ref="module_category_event_management"/>
        </record>

        <record id="group_event_manager" model="res.groups">
            <field name="name">Manager</field>
            <field name="category_id" ref="module_category_event_management"/>
            <field name="implied_ids" eval="[(4, ref('group_event_user'))]"/>
            <field name="users" eval="[(4, ref('base.user_root'))]"/>
        </record>

    </data>

    <data noupdate="1">

        <!-- Multi - Company Rules -->
        <record model="ir.rule" id="event_event_comp_rule">
            <field name="name">Event multi-company</field>
            <field name="model_id" ref="model_event_event"/>
            <field name="global" eval="True"/>
            <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
        </record>

        <record model="ir.rule" id="event_registration_comp_rule">
            <field name="name">Event Registration multi-company</field>
            <field name="model_id" ref="model_event_registration"/>
            <field name="global" eval="True"/>
            <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
        </record>

        <record model="ir.rule" id="report_event_registration_comp_rule">
            <field name="name">Report Event Registration multi-company</field>
            <field name="model_id" ref="model_report_event_registration"/>
            <field name="global" eval="True"/>
            <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
        </record>

    </data>
</openerp>
