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

    <record id="group_mrp_user" model="res.groups">
        <field name="name">User</field>
        <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
        <field name="category_id" ref="base.module_category_manufacturing"/>
    </record>
    <record id="group_mrp_manager" model="res.groups">
        <field name="name">Manager</field>
        <field name="category_id" ref="base.module_category_manufacturing"/>
        <field name="implied_ids" eval="[(4, ref('group_mrp_user'))]"/>
        <field name="users" eval="[(4, ref('base.user_root'))]"/>
    </record>

    <record id="group_mrp_routings" model="res.groups">
        <field name="name">Manage Routings</field>
        <field name="category_id" ref="base.module_category_hidden"/>
    </record>

    <!-- restrict access to menu -->
    <record model='ir.ui.menu' id="mrp_Sched_all">
        <field eval="[(6,0,[ref('group_mrp_manager')])]" name="groups_id"/>
    </record>

</data>
<data noupdate="1">
<!-- Multi -->
    <record model="ir.rule" id="mrp_production_rule">
        <field name="name">mrp_production multi-company</field>
        <field name="model_id" search="[('model','=','mrp.production')]" model="ir.model"/>
        <field name="global" eval="True"/>
        <field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
    </record>

    <record model="ir.rule" id="mrp_workcenter_rule">
        <field name="name">mrp_workcenter multi-company</field>
        <field name="model_id" search="[('model','=','mrp.workcenter')]" model="ir.model"/>
        <field name="global" eval="True"/>
        <field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
    </record>

    <record model="ir.rule" id="mrp_bom_rule">
        <field name="name">mrp_bom multi-company</field>
        <field name="model_id" search="[('model','=','mrp.bom')]" model="ir.model"/>
        <field name="global" eval="True"/>
        <field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
    </record>

    <record model="ir.rule" id="mrp_routing_rule">
        <field name="name">mrp_routing multi-company</field>
        <field name="model_id" search="[('model','=','mrp.routing')]" model="ir.model"/>
        <field name="global" eval="True"/>
        <field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
    </record>

    <record model="ir.rule" id="mrp_routing_workcenter_rule">
        <field name="name">mrp_routing_workcenter multi-company</field>
        <field name="model_id" search="[('model','=','mrp.routing.workcenter')]" model="ir.model"/>
        <field name="global" eval="True"/>
        <field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
    </record>

</data>
</openerp>
