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

        <record id="note_project_manager_type" model="board.note.type">
            <field name="name">Project</field>
        </record>

        <!-- Editable My task -->
        <record id="view_task_tree" model="ir.ui.view">
            <field name="name">project.task.tree</field>
            <field name="model">project.task</field>
            <field name="type">tree</field>
            <field eval="99" name="priority"/>
            <field name="arch" type="xml">
                  <tree editable="top" colors="red:date_deadline&lt;current_date;blue:date_deadline==current_date;black:date_deadline&gt;current_date" string="My Tasks">
                    <field name="name"/>
                    <field name="project_id"/>
                    <field name="date_deadline"/>
                    <field name="priority"/>
                    <field name="planned_hours" widget="float_time"/>
                    <field name="effective_hours" widget="float_time"/>
                    <field name="progress" widget="progressbar"/>
                </tree>
            </field>
        </record>

        <record id="view_delegated_task_tree" model="ir.ui.view">
            <field name="name">project.task.delegated.tree</field>
            <field name="model">project.task</field>
            <field name="type">tree</field>
            <field eval="99" name="priority"/>
            <field name="arch" type="xml">
                  <tree colors="red:date_deadline&lt;current_date;blue:date_deadline==current_date;black:date_deadline&gt;current_date" string="My Delegated Tasks">
                    <field name="user_id"/>
                    <field name="name"/>
                    <field name="project_id"/>
                    <field name="date_deadline"/>
                    <field name="total_hours" widget="float_time"/>
                    <field name="progress" widget="progressbar"/>
                    <field name="type_id"/>
                </tree>
            </field>
        </record>


        <record id="action_view_task_tree" model="ir.actions.act_window">
            <field name="name">My Open Tasks</field>
            <field name="res_model">project.task</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="domain">[('user_id','=',uid),('state','=','open')]</field>
            <field name="view_id" ref="view_task_tree"/>
        </record>

        <record id="action_view_delegate_task_tree" model="ir.actions.act_window">
            <field name="name">My Delegated Tasks</field>
            <field name="res_model">project.task</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="domain">[('parent_ids.user_id','=',uid),('state', 'in', ('draft','open','pending'))]</field>
            <field name="view_id" ref="view_delegated_task_tree"/>
        </record>

        <record id="action_view_task_tree_deadline" model="ir.actions.act_window">
            <field name="name">My Task's Deadlines</field>
            <field name="res_model">project.task</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="domain">[('user_id','=',uid),('state','=','open'),('date_deadline','&lt;&gt;',False)]</field>
            <field name="view_id" ref="view_task_tree"/>
        </record>

        <record id="action_view_board_note_tree" model="ir.actions.act_window">
            <field name="name">Public Notes</field>
            <field name="res_model">board.note</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="domain">[('type','=','Project')]</field>
        </record>
        <record id="board_project_form" model="ir.ui.view">
            <field name="name">board.project.form</field>
            <field name="model">board.board</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="My Board">
                    <hpaned>
                        <child1>
                            <action colspan="4"  name="%(action_view_task_tree)d" string="My Open Tasks" width="510"/>
                            <action colspan="4"  name="%(action_view_delegate_task_tree)d" string="My Delegated Tasks" width="510"/>
                   		</child1>
                        <child2>
                        <vpaned>
                        	<child1>
                        		<action colspan="4"  name="%(project.action_project_vs_remaining_hours_graph)d" string="Remaining Hours Per Project" />
                        	</child1>
                        	<child2>
                        		<action colspan="4"  name="%(project.action_project_vs_planned_total_hours_graph)d" string="My Projects: Planned Vs Total Hours" />
                        	</child2>
                        </vpaned>
                        </child2>
                    </hpaned>
                </form>
            </field>
        </record>

        <record id="open_board_project" model="ir.actions.act_window">
            <field name="name">Project Dashboard</field>
            <field name="res_model">board.board</field>
            <field name="view_type">form</field>
            <field name="view_mode">form</field>
            <field name="usage">menu</field>
            <field name="view_id" ref="board_project_form"/>
        </record>

        <menuitem
            id="next_id_86"
            name="Dashboard"
            sequence="0"
            parent="base.menu_project_report"/>

        <menuitem
            action="open_board_project"
            icon="terp-graph"
            id="menu_board_project"
            parent="next_id_86"
            sequence="1"/>

        <menuitem
            icon="terp-project" id="base.menu_main_pm"
            name="Project" sequence="10" action="open_board_project"
            groups="group_project_manager,group_project_user,base.group_system"/>

    </data>
</openerp>
