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

    <record id="group_stock_user" model="res.groups">
        <field name="name">User</field>
        <field name="category_id" ref="base.module_category_warehouse_management"/>
        <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
    </record>
    <record id="group_stock_manager" model="res.groups">
        <field name="name">Manager</field>
        <field name="category_id" ref="base.module_category_warehouse_management"/>
        <field name="implied_ids" eval="[(4, ref('group_stock_user')), (4, ref('account.group_account_user'))]"/>
        <field name="users" eval="[(4, ref('base.user_root'))]"/>
    </record>

    <record id="group_production_lot" model="res.groups">
        <field name="name">Manage Serial Numbers</field>
        <field name="category_id" ref="base.module_category_hidden"/>
    </record>

    <record id="group_tracking_lot" model="res.groups">
        <field name="name">Manage Logistic Serial Numbers</field>
        <field name="category_id" ref="base.module_category_hidden"/>
    </record>

    <record id="group_inventory_valuation" model="res.groups">
        <field name="name">Manage Inventory valuation</field>
        <field name="category_id" ref="base.module_category_hidden"/>
    </record>

    <record id="group_locations" model="res.groups">
        <field name="name">Manage Multiple Locations and Warehouses</field>
        <field name="category_id" ref="base.module_category_hidden"/>
    </record>

</data>
<data noupdate="1">
<!-- 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>
