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

    <record id="group_stock_manager" model="res.groups">
        <field name="name">Warehouse / Manager</field>
    </record>
    <record id="group_stock_user" model="res.groups">
        <field name="name">Warehouse / User</field>
    </record>

    <record model='ir.ui.menu' id='menu_stock_root'>
        <field name="groups_id" eval="[(6,0,[ref('group_stock_manager'),ref('group_stock_user'),ref('base.group_system')])]"/>
    </record>

<!-- multi -->

    <record model="ir.rule" id="stock_picking_rule">
        <field name="name">stock_picking multi-company</field>
        <field name="model_id" search="[('model','=','stock.picking')]" model="ir.model"/>
        <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="stock_warehouse_comp_rule">
        <field name="name">Warehouse multi-company</field>
        <field name="model_id" ref="model_stock_warehouse"/>
        <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="stock_location_comp_rule">
        <field name="name">Location multi-company</field>
        <field name="model_id" ref="model_stock_location"/>
        <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="stock_move_rule">
         <field name="name">stock_move multi-company</field>
        <field name="model_id" search="[('model','=','stock.move')]" model="ir.model"/>
        <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="stock_inventory_line_comp_rule">
        <field name="name">Inventory Line multi-company</field>
        <field name="model_id" ref="model_stock_inventory_line"/>
        <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="stock_inventory_comp_rule">
        <field name="name">Inventory multi-company</field>
        <field name="model_id" ref="model_stock_inventory"/>
        <field name="global" eval="True"/>
        <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
    </record>

</data>
</openerp>
