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

    <record id="group_project_finance" model="res.groups">
        <field name="name">Project / Financial Manager</field>
    </record>

    <record id="group_project_finance_user" model="res.groups">
        <field name="name">Project / Financial User</field>
    </record>

    <record id="group_project_manager" model="res.groups">
        <field name="name">Project / Manager</field>
    </record>

    <record id="group_project_user" model="res.groups">
        <field name="name">Project / User</field>
    </record>

    <record id="base.group_sale_salesman" model="res.groups">
        <field name="name">Sales / User</field>
    </record>

    <record model="ir.ui.menu" id="menu_definitions">
        <field name="groups_id" eval="[(6,0,[ref('group_project_manager')])]"/>
    </record>

    <record model="ir.rule" id="project_comp_rule">
        <field name="name">Project multi-company</field>
        <field name="model_id" ref="model_project_project"/>
        <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="task_comp_rule">
        <field name="name" >Task multi-company</field>
        <field name="model_id" ref="model_project_task"/>
        <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="task_visibility_rule">
        <field name="name" >Tasks According to User and Project</field>
        <field name="model_id" ref="model_project_task"/>
        <field name="global" eval="True"/>
        <field name="domain_force">['|','|','|',('user_id','=',False),('user_id','=',user.id),('project_id.members','in', [user.id]),('project_id.user_id','=',user.id)]</field>
    </record>

     <record model="ir.rule" id="project_details_comp_rule">
        <field name="name" >Projects According to User</field>
        <field name="model_id" ref="model_project_project"/>
        <field name="groups" eval="[(6, 0, [ref('group_project_manager')])]"/>
        <field name="domain_force">[('user_id','=',user.id)]</field>
    </record>

</data>
</openerp>
