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

        <menuitem id="menu_scrum"
            name="Scrum"
            parent="base.menu_main_pm" sequence="3"/>

        <!-- Scrum Project -->

        <record id="view_project_project_form" model="ir.ui.view">
            <field name="name">project.project.form</field>
            <field name="model">project.project</field>
            <field name="type">form</field>
            <field name="inherit_id" ref="project.edit_project"/>
            <field name="arch" type="xml">
                <group name="misc" position="after">
                    <group col="2" colspan="2">
                        <separator string="Scrum Data" colspan="4"/>
                        <field name="product_owner_id" required="1" select="1"/>
                        <field name="sprint_size"/>
                    </group>
                </group>
            </field>
        </record>

        <!--
       Product backlog
       -->

        <record id="view_scrum_product_backlog_tree" model="ir.ui.view">
            <field name="name">project.scrum.product.backlog.tree</field>
            <field name="model">project.scrum.product.backlog</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree colors="grey:state in ('cancel','done');blue:state in ('pending')" string="Product Backlog">
                    <field name="sequence"/>
                    <field name="name"/>
                    <field name="project_id"/>
                    <field name="sprint_id"/>
                    <field name="user_id"/>
                    <field name="progress" widget="progressbar"/>
                    <field name="expected_hours" sum="Planned hours" widget="float_time" string="Total Planned Hours"/>
                    <field name="effective_hours" sum="Effective hours" widget="float_time" string="Total Spent Hours"/>
                    <field name="state"/>
                    <button type="object" string="Open" name="button_open" states="draft,pending" icon="terp-camera_test"/>
                    <button type="object" string="Pending" name="button_pending" states="open" icon="gtk-media-pause"/>
                    <button type="action" string="Convert to Task" name="%(action_scrum_backlog_to_task)d" states="pending" icon="terp-stock_effects-object-colorize"/>
                    <button type="action" string="Merge Backlogs" name="%(action_scrum_backlog_merge)d" states="pending" icon="terp-stock_effects-object-colorize"/>
                    <button type="object" string="Close" name="button_close" states="open,pending" icon="terp-dialog-close"/>
                </tree>
            </field>
        </record>

        <record id="view_scrum_product_backlog_form" model="ir.ui.view">
            <field name="name">project.scrum.product.backlog.form</field>
            <field name="model">project.scrum.product.backlog</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Product backlog">
                    <group colspan="4" col="8">
                        <field name="name" select="1"/>
                        <field name="project_id" select="1"/>
                        <field domain="[('project_id','=',project_id), ('state','in', ['draft','open'])]" name="sprint_id" select="1"/>
      					<button name="button_postpone" string="Postpone" type="object"
							help="Postpone backlog" colspan="2"
                         icon="gtk-convert"  attrs="{'invisible':[('state','=','done')]}"/>
                        <field name="user_id" select="1"/>
                        <field name="sequence" groups="base.group_extended"/>
                        <field name="create_date"/>
                        <field name="progress" widget="progressbar"/>
                    </group>
                    <notebook colspan="4">
                        <page string="Information">
                            <group colspan="6" col="8">
                                <field name="expected_hours" widget="float_time"/>
                                <field name="effective_hours" widget="float_time"/>
                                <field name="task_hours" widget="float_time"/>
                            </group>
                            <separator string="Feature Description" colspan="4"/>
                            <field colspan="4" name="note" nolabel="1"/>
                        </page>
                        <page string="Tasks">
                            <field colspan="4" name="tasks_id" nolabel="1" widget="one2many_list" context="{'default_project_id':project_id, 'default_sprint_id':sprint_id, 'default_product_backlog_id':active_id}">
                                <tree colors="grey:state in ('cancelled','done');blue:remaining_hours&lt;0;red:bool(date_deadline) and (date_deadline&lt;current_date) and (state in ('draft','open'));black:state not in ('cancelled','done')" string="Tasks">
                                        <field name="sequence" invisible="0"/>
                                        <field name="name"/>
                                        <field name="user_id"/>
                                        <field name="delegated_user_id" invisible="context.get('show_delegated', True)"/>
                                        <field name="planned_hours" widget="float_time" sum="Planned Hours"/>
                                        <field name="total_hours" widget="float_time"/>
                                        <field name="remaining_hours" widget="float_time" sum="Remaining Hours" invisible="context.get('set_visible',False)"/>
                                        <field name="date_deadline" invisible="context.get('set_visible',False)"/>
                                        <field name="type_id" groups="base.group_extended" invisible="context.get('set_visible',False)"/>
                                        <field name="date_start" invisible="1"/>
                                        <field name="date_end" invisible="1"/>
                                        <button name="next_type" invisible="context.get('set_visible',False)"
                                            states="draft,open,pending"
                                            string="Change Stage"
                                            type="object"
                                            icon="gtk-go-forward"
                                            groups="base.group_extended"
                                            help="Change Type"/>
                                        <field name="progress" widget="progressbar" invisible="context.get('set_visible',False)"/>
                                        <field name="state" invisible="context.get('set_visible',False)"/>
                                        <button name="do_open" states="pending,draft,done,cancel" string="Start Task" type="object" icon="terp-camera_test" help="For changing to open state" invisible="context.get('set_visible',False)"/>
                                        <button groups="base.group_extended" name="%(project.action_project_task_delegate)d" states="pending,open,draft" string="Delegate" type="action" icon="gtk-sort-descending" help="For changing to delegate state"/>
                                        <button name="do_close" states="draft,pending,open" string="Done" type="object" icon="gtk-jump-to" help="For changing to done state"/>
                                        <button name="do_cancel" states="draft,open,pending" string="Cancel" type="object" icon="gtk-stop" help="For cancelling the task"/>
                                </tree>
                            </field>
                        </page>
                    </notebook>
                    <group col="8" colspan="4">
                        <field name="state" select="1" readonly="1"/>
                        <button type="object" string="Open" name="button_open" states="draft,pending" icon="terp-camera_test"/>
                        <button type="action" string="Convert to Task" name="%(action_scrum_backlog_to_task)d" states="pending" icon="gtk-execute"/>
                        <button type="object" string="Pending" name="button_pending" states="open" icon="gtk-media-pause"/>
                        <button type="object" string="Close" name="button_close" states="open,pending" icon="terp-dialog-close"/>
                        <button type="object" string="Set to Draft" name="button_draft" states="cancel,done" icon="gtk-convert"/>
                        <button type="object" string="Cancel" name="button_cancel" states="open,pending" icon="gtk-stop"/>
                    </group>
                </form>
            </field>
        </record>

        <record model="ir.ui.view" id="view_scrum_product_backlog_search">
            <field name="name">project.scrum.product.backlog.search</field>
            <field name="model">project.scrum.product.backlog</field>
            <field name="type">search</field>
            <field name="arch" type="xml">
                <search string="Product Backlogs">
                    <group col="10" colspan="4">
                        <filter default="1"
                            icon="terp-check"
                            string="Current"
                            name="current"
                            domain="['|','&amp;',('sprint_id.date_start','&lt;=',time.strftime('%%Y-%%m-%%d')), ('sprint_id.date_stop','&gt;=',time.strftime('%%Y-%%m-%%d')), ('state','in',['draft','open','pending'])]"
                            help="Draft, Open and Pending Backlogs"/>
                        <separator orientation="vertical"/>
                        <filter icon="terp-camera_test" string="Open" domain="[('state','=','open')]" help="Open Backlogs"/>
                        <filter icon="terp-gtk-media-pause" string="Pending" domain="[('state','=','pending')]" help="Pending Backlogs"/>
                        <separator orientation="vertical"/>
                        <filter string="Editable" icon="terp-folder-blue" domain="[]" context="{'set_editable':'1'}"/>
                        <separator orientation="vertical"/>
                        <field name="name"/>
                        <field name="project_id"/>
                        <field name="sprint_id" domain="[('state','in',('draft','open'))]">
                            <filter icon="terp-check"
                                string="Sprints"
                                domain="[('sprint_id.state','=','open')]"
                                help="Backlogs Assigned To Current Sprints"/>
                            <filter icon="terp-personal-"
                                string="Sprints"
                                domain="[('sprint_id','=',False)]"
                                help="Backlogs Not Assigned To Sprints."/>
                        </field>
                        <field name="user_id">
                            <filter icon="terp-personal"
                                string="My Backlogs"
                                name="my_user_id"
                                domain="[('user_id','=',uid)]"
                                help="My Backlogs"/>
                        </field>
                    </group>
                    <newline/>
                    <group expand="0" string="Group By..." colspan="4" col="20" groups="base.group_extended">
                        <filter string="Author" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
                        <separator orientation="vertical"/>
                        <filter string="Project" icon="terp-folder-blue" domain="[]" context="{'group_by':'project_id'}"/>
                        <filter string="Sprint" icon="terp-gtk-jump-to-ltr" domain="[]" context="{'group_by':'sprint_id'}"/>
                        <separator orientation="vertical"/>
                        <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
                    </group>
                </search>
            </field>
        </record>

        <record id="action_product_backlog_form" model="ir.actions.act_window">
            <field name="name">Product Backlogs</field>
            <field name="res_model">project.scrum.product.backlog</field>
            <field name="view_type">form</field>
            <field name="context">{'search_default_current': 1,'search_default_user_id':uid,'search_default_project_id':project_id}</field>
            <field name="search_view_id" ref="view_scrum_product_backlog_search"/>
        </record>
        <menuitem
            action="action_product_backlog_form"
            id="menu_action_product_backlog_form"
            sequence="10"
            parent="menu_scrum"/>

        <!--
              Scrum Sprint
       -->

        <record id="view_scrum_sprint_tree" model="ir.ui.view">
            <field name="name">project.scrum.sprint.tree</field>
            <field name="model">project.scrum.sprint</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree colors="blue:state in ('draft','pending');grey:state in ('cancel','done')" string="Scrum Sprint">
                    <field name="name"/>
                    <field name="project_id"/>
                    <field name="scrum_master_id"/>
                    <field name="product_owner_id" invisible="1"/>
                    <field name="date_start"/>
                    <field name="progress" widget="progressbar"/>
                    <field name="effective_hours" sum="Effective hours" widget="float_time"/>
                    <field name="expected_hours" sum="Planned hours" widget="float_time"/>
                    <field name="state"/>
                    <button type="object" string="Open" name="button_open" states="draft,pending" icon="terp-camera_test"/>
                    <button type="object" string="Pending" name="button_pending" states="open" icon="gtk-media-pause"/>
                    <button type="object" string="Close" name="button_close" states="open,pending" icon="terp-dialog-close"/>
                    <button type="object" string="Set to Draft" name="button_draft" states="cancel,done" icon="gtk-convert"/>
                </tree>
            </field>
        </record>
        <record id="view_scrum_sprint_form" model="ir.ui.view">
            <field name="name">project.scrum.sprint.form</field>
            <field name="model">project.scrum.sprint</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Scrum Sprint">
                    <group colspan="4" col="6">
                        <field name="name" select="1"/>
                        <field name="project_id" on_change="onchange_project_id(project_id)"/>
                    </group>
                    <notebook colspan="4">
                        <page string="Sprint Info">
                            <group colspan="2" col="2">
                                <separator string="Responsible" colspan="2"/>
                                <field name="product_owner_id"/>
                                <field name="scrum_master_id"/>
                            </group>
                            <group colspan="2" col="2">
                                <separator string="Dates" colspan="2"/>
                                <field name="date_start" select="1"/>
                                <field name="date_stop"/>
                            </group>
                            <group colspan="2" col="2">
                                <separator string="Planning" colspan="2"/>
                                <field name="expected_hours" widget="float_time"/>
                                <field name="effective_hours" widget="float_time"/>
                                <field name="progress" widget="progressbar"/>
                            </group>
                        </page>
                        <page string="Daily Meetings">
                            <field colspan="4" name="meeting_ids" nolabel="1" widget="one2many_list">
                                <form string="Scrum Sprint">
                                    <group colspan="4" col="6">
                                            <field name="date"/>
                                            <field name="user_id"/>
                                    </group>
                                    <notebook colspan="4">
                                        <page string="Scrum Meeting">
                                            <separator colspan="4" string="What did you do since the last meeting?"/>
                                            <field colspan="4" name="question_yesterday" nolabel="1"/>
                                            <separator colspan="4" string="What do you plan to do till the next meeting?"/>
                                            <field colspan="4" name="question_today" nolabel="1"/>
                                            <separator colspan="4" string="Are there anything blocking you?"/>
                                            <field colspan="4" name="question_blocks" nolabel="1"/>
                                            <separator colspan="4" string=""/>
                							<button name="button_send_to_master" type="object" string="Send to Scrum Master" icon="gtk-ok"/>
                                            <button name="button_send_product_owner" type="object" string="Send to Product Owner" icon="gtk-ok"/>
                                        </page>
                                        <page string="Optional Info">
                                            <separator colspan="4" string="Are your Sprint Backlog estimate accurate ?"/>
                                            <field colspan="4" name="question_backlog" nolabel="1"/>
                                        </page>
                                        <page string="Links">
                                            <separator colspan="4" string="Tasks"/>
                                            <field colspan="4" name="task_ids" nolabel="1" domain="[('sprint_id','=',sprint_id)]"/>
                                        </page>
                                </notebook>
                            </form>
                            <tree string="Scrum Meeting">
                                <field name="date"/>
                                <field name="user_id"/>
                            </tree>
                            </field>
                        </page>
                        <page string="Review">
                            <field colspan="4" name="review" nolabel="1"/>
                        </page>
                        <page string="Retrospective">
                            <field colspan="4" name="retrospective" nolabel="1"/>
                        </page>
                    </notebook>
                    <group col="6" colspan="4">
                        <field name="state" readonly="1"/>
                        <button type="object" string="Open" name="button_open" states="draft,pending" icon="terp-camera_test"/>
                        <button type="object" string="Pending" name="button_pending" states="open" icon="gtk-media-pause"/>
                        <button type="object" string="Close" name="button_close" states="open,pending" icon="terp-dialog-close"/>
                        <button type="object" string="Set to Draft" name="button_draft" states="cancel,done" icon="gtk-convert"/>
                    </group>
                </form>
            </field>
        </record>

        <record model="ir.ui.view" id="view_scrum_sprint_search">
            <field name="name">project.scrum.sprint.search</field>
            <field name="model">project.scrum.sprint</field>
            <field name="type">search</field>
            <field name="arch" type="xml">
                <search string="Sprints">
                    <group col="10" colspan="4">
                        <filter name="terp-check" icon="terp-check" string="Current" domain="[('state','in',('draft','open'))]" help="Draft and open Sprints"/>
                        <separator orientation="vertical"/>
                        <filter icon="terp-camera_test" string="Open" domain="[('state','=','open')]" help="Open Sprints"/>
                        <filter icon="gtk-media-pause" string="Pending" domain="[('state','=','pending')]" help="Pending Sprints"/>
                        <separator orientation="vertical"/>
                        <field name="name"/>
                        <field name="project_id"/>
                        <field name="scrum_master_id"/>
                        <field name="date_start"/>
                    </group>
                    <newline/>
                    <group expand="0" string="Group By..." colspan="4" col="20">
                        <filter string="Product owner" icon="terp-personal" domain="[]" context="{'group_by':'product_owner_id'}"/>
                        <filter string="Scrum Master" icon="terp-personal" domain="[]"  context="{'group_by':'scrum_master_id'}"/>
                        <separator orientation="vertical"/>
                        <filter string="Project" icon="terp-folder-blue" domain="[]" context="{'group_by':'project_id'}"/>
                        <separator orientation="vertical"/>
                        <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
                        <separator orientation="vertical"/>
                        <filter string="Month" icon="terp-go-month" domain="[]" context="{'group_by':'date_start'}" help="Sprint Month"/>
                    </group>
                </search>
            </field>
        </record>

        <record id="action_sprint_all_tree" model="ir.actions.act_window">
            <field name="name">Sprints</field>
            <field name="res_model">project.scrum.sprint</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="view_id" ref="view_scrum_sprint_tree"/>
            <field name="context">{"search_default_filter_current": 1, "search_default_scrum_master_id":uid}</field>
            <field name="search_view_id" ref="view_scrum_sprint_search"/>
        </record>
        <menuitem
            sequence="20"
            action="action_sprint_all_tree" id="menu_action_sprint_all_tree" parent="menu_scrum"/>

        <!--
              Daily Meeting
       -->

        <record id="view_scrum_meeting_tree" model="ir.ui.view">
            <field name="name">project.scrum.meeting.tree</field>
            <field name="model">project.scrum.meeting</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Scrum Meeting">
                    <field name="date"/>
                    <field name="sprint_id"/>
                    <field name="project_id"/>
                    <field name="user_id"/>
                </tree>
            </field>
        </record>
        <record id="view_scrum_meeting_form" model="ir.ui.view">
            <field name="name">Scrum Meeting</field>
            <field name="model">project.scrum.meeting</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Scrum Meeting">
                    <group colspan="4" col="6">
                        <field name="date"/>
                        <field name="sprint_id" domain="[('state', '=', 'open')]"/>
                        <field name="user_id"/>
                    </group>
                    <notebook colspan="4">
                        <page string="Scrum Meeting">
                            <separator colspan="4" string="What did you do since the last meeting?"/>
                            <field colspan="4" name="question_yesterday" nolabel="1"/>
                            <separator colspan="4" string="What do you plan to do till the next meeting?"/>
                            <field colspan="4" name="question_today" nolabel="1"/>
                            <separator colspan="4" string="Are there anything blocking you?"/>
                            <field colspan="4" name="question_blocks" nolabel="1"/>
                            <separator colspan="4" string=""/>
							<button name="button_send_to_master" type="object" string="Send to Scrum Master" icon="gtk-ok"/>
                            <button name="button_send_product_owner" type="object" string="Send to Product Owner" icon="gtk-ok"/>
                        </page>
                        <page string="Optional Info">
                            <separator colspan="4" string="Are your Sprint Backlog estimate accurate ?"/>
                            <field colspan="4" name="question_backlog" nolabel="1"/>
                        </page>
                        <page string="Links">
                            <separator colspan="4" string="Tasks"/>
                            <field colspan="4" name="task_ids" nolabel="1" domain="[('sprint_id','=',sprint_id)]"/>
                        </page>
                    </notebook>
                </form>
            </field>
        </record>

        <record id="view_scrum_meeting_search" model="ir.ui.view">
            <field name="name">project_scrum.meeting.search</field>
            <field name="model">project.scrum.meeting</field>
            <field name="type">search</field>
            <field name="arch" type="xml">
                <search string="Scrum Sprint">
                    <group col="10" colspan="4">
                        <filter name="scrum_daily" icon="terp-go-today" string="Daily" domain="[('date','=',time.strftime('%%Y-%%m-%%d'))]" help="Daily Meetings"/>
                        <separator orientation="vertical"/>
                        <field name="sprint_id">
                            <filter icon="terp-check" string="Current" domain="[('sprint_id.state','in',('draft','open'))]" help="Current Sprints" default="1"/>
                        </field>
                        <field name="project_id"/>
                        <field name="date"/>
                    </group>
                    <newline/>
                    <group expand="0" string="Group By..." colspan="4" col="20">
                        <filter string="Sprint" icon="terp-gtk-jump-to-ltr" domain="[]" context="{'group_by':'sprint_id'}"/>
                        <separator orientation="vertical"/>
                        <filter string="Month" icon="terp-go-month" domain="[]" context="{'group_by':'date'}" help="Meeting Date"/>
                    </group>
                </search>
            </field>
        </record>

        <record id="action_meeting_form" model="ir.actions.act_window">
            <field name="name">Scrum Meetings</field>
            <field name="res_model">project.scrum.meeting</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="context">{'search_default_scrum_daily':1,'search_default_project_id':project_id}</field>
            <field name="search_view_id" ref="view_scrum_meeting_search"/>
        </record>
        <menuitem sequence="30"
            action="action_meeting_form" id="menu_action_meeting_form" parent="menu_scrum"/>

        <!--
       Clicks on a sprint:
       -->

        <record id="action_sprint_task_open" model="ir.actions.act_window">
            <field name="res_model">project.task</field>
            <field name="name">View sprint Tasks</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="domain">[('product_backlog_id', '=', active_id)]</field>
        </record>
        <record id="ir_scrum_sprint_open_task" model="ir.values">
            <field eval=" 'tree_but_open'" name="key2"/>
            <field eval="'project.scrum.sprint'" name="model"/>
            <field name="name">View sprint tasks</field>
            <field eval="'ir.actions.act_window,'+str(action_sprint_task_open)" name="value"/>
            <field eval="True" name="object"/>
        </record>

        <record id="action_sprint_backlog_open" model="ir.actions.act_window">
            <field name="res_model">project.scrum.product.backlog</field>
            <field name="name">View sprint backlog</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="domain">[('sprint_id', '=', active_id)]</field>
        </record>
        <record id="ir_scrum_sprint_open_sprint" model="ir.values">
            <field eval=" 'tree_but_open'" name="key2"/>
            <field eval="'project.scrum.sprint'" name="model"/>
            <field name="name">View sprint backlog</field>
            <field eval="'ir.actions.act_window,'+str(action_sprint_backlog_open)" name="value"/>
            <field eval="True" name="object"/>
        </record>

        <!--
       Clicks on a project
       -->

        <record id="dblc_proj" model="ir.actions.act_window">
            <field name="res_model">project.scrum.product.backlog</field>
            <field name="name">View project's backlog</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="domain">[('project_id', 'child_of', [active_id])]</field>
        </record>
        <record id="ir_scrum_project_backlog" model="ir.values">
            <field eval=" 'tree_but_open'" name="key2"/>
            <field eval="'project.scrum.project'" name="model"/>
            <field name="name">View project's backlog</field>
            <field eval="'ir.actions.act_window,'+str(dblc_proj)" name="value"/>
            <field eval="True" name="object"/>
        </record>
        <record id="dblc_proj2" model="ir.actions.act_window">
            <field name="res_model">project.task</field>
            <field name="name">View project's tasks</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="domain">[('project_id', 'child_of', [active_id])]</field>
        </record>
        <record id="ir_scrum_project_task" model="ir.values">
            <field eval=" 'tree_but_open'" name="key2"/>
            <field eval="'project.scrum.project'" name="model"/>
            <field name="name">View project's tasks</field>
            <field eval="'ir.actions.act_window,'+str(dblc_proj2)" name="value"/>
            <field eval="True" name="object"/>
        </record>

        <!--
        Tasks
        -->

        <record id="view_task_tree2" model="ir.ui.view">
            <field name="name">project.task.tree.scrum</field>
            <field name="model">project.task</field>
            <field name="type">tree</field>
            <field name="inherit_id" ref="project.view_task_tree2"/>
            <field name="arch" type="xml">
                <field name="user_id" position="after">
                    <field name="sprint_id" domain="[('state', 'in', ['draft', 'open'])]" invisible="context.get('sprint_invisible',True)"/>
                    <field name="product_backlog_id" invisible="1"/>
                </field>
            </field>
        </record>

        <record id="view_task_form2" model="ir.ui.view">
            <field name="name">project.task.scrum.form</field>
            <field name="model">project.task</field>
            <field name="type">form</field>
            <field name="inherit_id" ref="project.view_task_form2"/>
            <field name="arch" type="xml">
                <xpath expr="/form/group/field[@name='progress']" position="after">
                    <field domain="[('project_id','=',project_id),]" name="product_backlog_id" select="1"/>
                </xpath>
            </field>
        </record>

        <record id="view_task_form3" model="ir.ui.view">
            <field name="name">project.task.scrum.form2</field>
            <field name="model">project.task</field>
            <field name="type">form</field>
            <field name="inherit_id" ref="project.view_task_form2"/>
            <field name="arch" type="xml">
                <xpath expr="/form/notebook/page[@string='Extra Info']/group/field[@name='sequence']" position="after">
                    <field name="sprint_id" domain="[('state', 'in', ['draft', 'open'])]" />
                </xpath>
            </field>
        </record>

        <record id="view_task_search_form2" model="ir.ui.view">
            <field name="name">project.task.scrum.search</field>
            <field name="model">project.task</field>
            <field name="type">search</field>
            <field name="inherit_id" ref="project.view_task_search_form"/>
            <field name="arch" type="xml">
                <field name="project_id" position="after">
                    <field name="sprint_id" context="{'sprint_invisible':False}">
                        <filter icon="terp-check" string="Current" context="{'sprint_invisible':False}" domain="[('sprint_id.state','in',('draft','open'))]" help="Current Sprints"/>
                        <filter icon="gtk-find" string="Current" context="{'sprint_invisible':False}" domain="[]" help="View Sprints"/>
                    </field>
                </field>
            </field>
        </record>

        <record id="view_task_search_form3" model="ir.ui.view">
            <field name="name">project.task.scrum.search</field>
            <field name="model">project.task</field>
            <field name="type">search</field>
            <field name="inherit_id" ref="project.view_task_search_form"/>
            <field name="arch" type="xml">
                <xpath expr="/search/group[@string='Group By...']/filter[@string='Project']" position="after">
                	<separator orientation="vertical"/>
                    <filter string="Sprint" icon="terp-gtk-jump-to-ltr" domain="[]" context="{'group_by':'sprint_id'}"/>
                    <filter string="Backlog" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'product_backlog_id'}"/>
                </xpath>
            </field>
        </record>

        <act_window
        	context="{'search_default_sprint_id': [active_id]}"
            id="act_scrum_sprint_2_product_backlog"
            name="Backlogs"
            res_model="project.scrum.product.backlog"
            src_model="project.scrum.sprint"
            view_mode="tree,form"
            view_type="form"/>

        <act_window
        	context="{'search_default_sprint_id': active_id, 'search_default_user_id': uid, 'search_default_current':1}"
            id="act_scrum_sprint_2_project_task"
            name="Tasks"
            res_model="project.task"
            src_model="project.scrum.sprint"
            view_mode="tree,form"
            view_type="form"/>


    </data>
</openerp>
