<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data noupdate="1">
        <!-- This will set the unit of measure used in projects and tasks.-->
        <record id="base.main_company" model="res.company">
            <field name="project_time_mode_id" ref="product.product_uom_hour"></field>
        </record>

        <!-- Requests Links -->
        <record id="req_link_project" model="res.request.link">
            <field name="name">Project</field>
            <field name="object">project.project</field>
        </record>

        <record id="req_link_task" model="res.request.link">
            <field name="name">Project task</field>
            <field name="object">project.task</field>
        </record>

        <!-- Resource: project.project -->
        <record id="all_projects_account" model="account.analytic.account">
            <field name="name">Projects</field>
            <field name="code">3</field>
            <field name="type">view</field>
        </record>
        <function id="parent_project_default_set" model="ir.values" name="set" eval="('default',False,'parent_id', [('project.project', False)], all_projects_account, True, False, False, False, True)"/>

        <!-- Task Stages -->

        <record id="project_tt_analysis" model="project.task.type">
            <field name="sequence">1</field>
            <field name="name">Analysis</field>
            <field name="state">draft</field>
            <field name="case_default" eval="False"/>
        </record>
        <record id="project_tt_specification" model="project.task.type">
            <field name="sequence">2</field>
            <field name="name">Specification</field>
            <field name="state">pending</field>
            <field name="case_default" eval="True"/>
        </record>
        <record id="project_tt_design" model="project.task.type">
            <field name="sequence">2</field>
            <field name="name">Design</field>
            <field name="state">open</field>
            <field name="case_default" eval="True"/>
        </record>
        <record id="project_tt_development" model="project.task.type">
            <field name="sequence">3</field>
            <field name="name">Development</field>
            <field name="state">open</field>
            <field name="case_default" eval="True"/>
        </record>
        <record id="project_tt_testing" model="project.task.type">
            <field name="sequence">4</field>
            <field name="name">Testing</field>
            <field name="state">open</field>
            <field name="case_default" eval="True"/>
        </record>
        <record id="project_tt_merge" model="project.task.type">
            <field name="sequence">5</field>
            <field name="name">Merge</field>
            <field name="state">open</field>
            <field name="case_default" eval="False"/>
            <field name="fold" eval="True"/>
        </record>
        <record id="project_tt_deployment" model="project.task.type">
            <field name="sequence">100</field>
            <field name="name">Done</field>
            <field name="state">done</field>
            <field name="case_default" eval="True"/>
            <field name="fold" eval="True"/>
        </record>
        <record id="project_tt_cancel" model="project.task.type">
            <field name="sequence">200</field>
            <field name="name">Cancelled</field>
            <field name="state">cancelled</field>
            <field name="case_default" eval="True"/>
            <field name="fold" eval="True"/>
        </record>
    </data>

    <data>
        <!-- Task-related subtypes for messaging / Chatter -->
        <record id="mt_task_new" model="mail.message.subtype">
            <field name="name">Task Created</field>
            <field name="res_model">project.task</field>
            <field name="default" eval="False"/>
            <field name="description">Task created</field>
        </record>
        <record id="mt_task_started" model="mail.message.subtype">
            <field name="name">Task Started</field>
            <field name="res_model">project.task</field>
            <field name="default" eval="False"/>
            <field name="description">Task started</field>
        </record>
        <record id="mt_task_blocked" model="mail.message.subtype">
            <field name="name">Task Blocked</field>
            <field name="res_model">project.task</field>
            <field name="default" eval="False"/>
            <field name="description">Task blocked</field>
        </record>
        <record id="mt_task_closed" model="mail.message.subtype">
            <field name="name">Task Done</field>
            <field name="res_model">project.task</field>
            <field name="default" eval="False"/>
            <field name="description">Task closed</field>
        </record>
        <record id="mt_task_stage" model="mail.message.subtype">
            <field name="name">Stage Changed</field>
            <field name="res_model">project.task</field>
            <field name="default" eval="False"/>
            <field name="description">Stage changed</field>
        </record>
        <!-- Project-related subtypes for messaging / Chatter -->
        <record id="mt_project_task_new" model="mail.message.subtype">
            <field name="name">Task Created</field>
            <field name="res_model">project.project</field>
            <field name="default" eval="False"/>
            <field name="parent_id" eval="ref('mt_task_new')"/>
            <field name="relation_field">project_id</field>
        </record>
        <record id="mt_project_task_started" model="mail.message.subtype">
            <field name="name">Task Started</field>
            <field name="res_model">project.project</field>
            <field name="default" eval="False"/>
            <field name="parent_id" eval="ref('mt_task_started')"/>
            <field name="relation_field">project_id</field>
        </record>
        <record id="mt_project_task_blocked" model="mail.message.subtype">
            <field name="name">Task Blocked</field>
            <field name="res_model">project.project</field>
            <field name="parent_id" eval="ref('mt_task_blocked')"/>
            <field name="relation_field">project_id</field>
        </record>
        <record id="mt_project_task_closed" model="mail.message.subtype">
            <field name="name">Task Done</field>
            <field name="res_model">project.project</field>
            <field name="parent_id" eval="ref('mt_task_closed')"/>
            <field name="relation_field">project_id</field>
        </record>
        <record id="mt_project_task_stage" model="mail.message.subtype">
            <field name="name">Task Stage Changed</field>
            <field name="res_model">project.project</field>
            <field name="parent_id" eval="ref('mt_task_stage')"/>
            <field name="relation_field">project_id</field>
        </record>

        <!-- notify all employees of module installation -->
        <record model="mail.message" id="module_install_notification">
            <field name="model">mail.group</field>
            <field name="res_id" ref="mail.group_all_employees"/>
            <field name="type">notification</field>
            <field name="subtype_id" ref="mail.mt_comment"/>
            <field name="subject">Project Management application installed!</field>
            <field name="body"><![CDATA[<p>Manage multi-level projects and tasks.  You can delegate tasks, track task work, and review your planning.</p>
<p>You can manage todo lists on tasks by installing the <i>Todo Lists</i> application, supporting the Getting Things Done (GTD) methodology.</p>
<p>You can also manage issues/bugs in projects by installing the "Issue Tracker" application.</p>]]></field>
        </record>
    </data>
</openerp>
