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

        <record id="view_task_history_tree" model="ir.ui.view">
            <field name="name">project.task.history.cumulative.tree</field>
            <field name="model">project.task.history.cumulative</field>
            <field name="arch" type="xml">
                <tree string="Tasks's Cumulative Flow" create="false">
                    <field name="date"/>
                    <field name="project_id"/>
                    <field name="task_id"/>
                    <field name="type_id"/>
                    <field name="user_id"/>
                    <field name="remaining_hours"/>
                    <field name="kanban_state"/>
                    <field name="state" groups="base.group_no_one"/>
                </tree>
            </field>
        </record>

        <record id="view_task_history_graph" model="ir.ui.view">
            <field name="name">project.task.history.cumulative.graph</field>
            <field name="model">project.task.history.cumulative</field>
            <field name="arch" type="xml">
                <!-- <field name="project_id"/> -->
                <graph string="Project Tasks" type="bar">
                    <field name="date"/>
                    <field name="planned_hours" operator="+"/>
                    <field name="type_id" group="True"/>
                </graph>
            </field>
        </record>

        <record id="view_task_history_search" model="ir.ui.view">
            <field name="name">project.task.history.cumulative.search</field>
            <field name="model">project.task.history.cumulative</field>
            <field name="arch" type="xml">
                <search string="Task's Analysis">
                    <field name="date"/>
                    <field name="project_id"/>
                    <field name="user_id"/>
                    <filter name="open" string="In Progress Tasks" domain="[('state','in',('open','draft'))]"/>
                    <filter string="Pending Tasks" domain="[('state','=','pending')]" context="{'show_delegated':False}"/>
                    <separator/>
                    <filter name="kanban_blocked" string="Blocked" domain="[('kanban_state','=','blocked')]"/>
                    <filter name="kanban_ready" string="Ready" domain="[('kanban_state','=','done')]"/>
                    <separator/>
                    <filter string="My Tasks" domain="[('user_id','=',uid)]"/>
                    <filter string="Unassigned Tasks" domain="[('user_id','=',False)]"/>
                    <separator/>
                    <filter string="My Projects" domain="[('project_id.user_id','=',uid)]"/>
                </search>
            </field>
        </record>

        <record id="action_view_task_history_cumulative" model="ir.actions.act_window">
            <field name="name">Cumulative Flow</field>
            <field name="res_model">project.task.history.cumulative</field>
            <field name="view_type">form</field>
            <field name="view_mode">graph,tree</field>
            <field name="view_id" ref="view_task_history_graph"/>
            <field name="filter" eval="False"/>
            <field name="context">{"search_default_open":1, "search_default_this_month": 1}</field>
        </record>
        <menuitem action="action_view_task_history_cumulative"
            id="menu_action_view_task_history_cumulative"
            parent="base.menu_project_report"/>

    </data>
</openerp>
