<?xml version="1.0" encoding="utf-8"?>
<terp>
    <data>
        
        
        <!--
		Usual views
		-->
        
        
        <!-- Scrum Project -->
        
        <record id="view_scrum_project_form" model="ir.ui.view">
            <field name="name">scrum.project.form</field>
            <field name="model">scrum.project</field>
            <field name="type">form</field>
            <field name="inherit_id" ref="project.edit_project"/>
            <field name="arch" type="xml">
                <field name="warn_manager" position="after">
                    <newline/>
                    <field name="product_owner_id" required="1" select="1"/>
                    <field name="sprint_size"/>
                </field>
            </field>
        </record>
        
        <record id="view_scrum_project_tree" model="ir.ui.view">
            <field name="name">scrum.project.tree</field>
            <field name="model">scrum.project</field>
            <field name="type">tree</field>
            <field name="field_parent">child_id</field>
            <field name="arch" type="xml">
                <tree string="Scrum Projects">
                    <field name="name"/>
                    <field name="manager"/>
                    <field name="product_owner_id"/>
                    <field name="planned_hours" sum="Planned hours" widget="float_time"/>
                    <field name="effective_hours" sum="Effective hours" widget="float_time"/>
                </tree>
            </field>
        </record>
        <record id="action_scrum_project_tree" model="ir.actions.act_window">
            <field name="name">Projects</field>
            <field name="res_model">scrum.project</field>
            <field name="view_type">tree</field>
            <field name="view_id" ref="view_scrum_project_tree"/>
            <field name="domain">[('parent_id','=',False),('scrum','=',1)]</field>
        </record>
        <menuitem id="next_id_67" name="Scrum" parent="project.menu_main"/><menuitem action="action_scrum_project_tree" id="menu_action_scrum_project_tree" parent="next_id_67"/>
        
        <record id="action_scrum_project_form" model="ir.actions.act_window">
            <field name="name">Edit Projects</field>
            <field name="res_model">scrum.project</field>
            <field name="view_type">form</field>
            <field name="view_id" ref="view_scrum_project_form"/>
            <field name="domain">[('scrum','=',1)]</field>
        </record>
        <menuitem action="action_scrum_project_form" id="menu_action_scrum_project_form" parent="scrum.menu_action_scrum_project_tree"/>
        
        
        <!--
	Product backlog
	-->
        
        <record id="view_scrum_product_backlog_tree" model="ir.ui.view">
            <field name="name">scrum.product.backlog.tree</field>
            <field name="model">scrum.product.backlog</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Scrum Product backlog">
                    <field name="priority"/>
                    <field name="sequence"/>
                    <field name="name"/>
                    <field name="sprint_id"/>
                    <field name="progress"/>
                    <field name="effective_hours" sum="Effective hours" widget="float_time"/>
                    <field name="planned_hours" sum="Planned hours" widget="float_time"/>
                    <field name="state"/>
                </tree>
            </field>
        </record>
        
        <record id="view_scrum_product_backlog_form" model="ir.ui.view">
            <field name="name">scrum.product.backlog.form</field>
            <field name="model">scrum.product.backlog</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Scrum Product backlog">
                    <notebook>
                        <page string="Product backlog">
                            <field colspan="4" name="name" select="1"/>
                            <field name="priority"/>
                            <field name="sequence"/>
                            <field name="project_id" select="1"/>
                            <field domain="[('project_id','=',project_id)]" name="sprint_id" select="1"/>
                            <field name="user_id" select="1"/>
                            <field name="active" select="1"/>
                            <field colspan="4" name="note"/>
                            <field name="state" select="1"/>
                            <field name="progress"/>
                            <field name="effective_hours" widget="float_time"/>
                            <field name="planned_hours" widget="float_time"/>
                        </page>
                        <page string="Tasks">
                            <field colspan="4" name="tasks_id" nolabel="1" widget="one2many_list"/>
                        </page>
                    </notebook>
                </form>
            </field>
        </record>
        <record id="action_product_backlog_form" model="ir.actions.act_window">
            <field name="name">Backlogs</field>
            <field name="res_model">scrum.product.backlog</field>
            <field name="view_type">form</field>
        </record>
        <menuitem action="action_product_backlog_form" id="menu_action_product_backlog_form" parent="scrum.next_id_67"/>
        
        <record id="action_product_backlog_form_draft" model="ir.actions.act_window">
            <field name="name">Draft Backlogs</field>
            <field name="res_model">scrum.product.backlog</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="domain">[('state','=','draft')]</field>
        </record>
        <menuitem action="action_product_backlog_form_draft" id="menu_action_product_backlog_form_draft" parent="scrum.menu_action_product_backlog_form"/>
        
        <record id="action_product_backlog_form_open" model="ir.actions.act_window">
            <field name="name">Opened Backlogs</field>
            <field name="res_model">scrum.product.backlog</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="domain">[('state','=','open')]</field>
        </record>
        <menuitem action="action_product_backlog_form_open" id="menu_action_product_backlog_form_open" parent="scrum.menu_action_product_backlog_form"/>
        
        
        
        <!--
		Scrum Sprint
	-->
        
        <record id="view_scrum_sprint_tree" model="ir.ui.view">
            <field name="name">scrum.sprint.tree</field>
            <field name="model">scrum.sprint</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Scrum Sprint">
                    <field name="name"/>
                    <field name="project_id"/>
                    <field name="date_start"/>
                    <field name="date_stop"/>
                    <field name="progress"/>
                    <field name="effective_hours" sum="Effective hours" widget="float_time"/>
                    <field name="planned_hours" sum="Planned hours" widget="float_time"/>
                    <field name="state"/>
                </tree>
            </field>
        </record>
        <record id="view_scrum_sprint_form" model="ir.ui.view">
            <field name="name">scrum.sprint.form</field>
            <field name="model">scrum.sprint</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Scrum Sprint">
                    <notebook>
                        <page string="Sprint Info">
                            <field colspan="4" name="name" select="1"/>
                            <newline/>
                            <field name="project_id" on_change="onchange_project_id(project_id)"/>
                            <newline/>
                            <field name="date_start" select="1"/>
                            <field name="date_stop"/>
                            <field name="product_owner_id"/>
                            <field name="scrum_master_id"/>
                            <field name="progress"/>
                            <field name="effective_hours" widget="float_time"/>
                            <field name="planned_hours" widget="float_time"/>
                            <newline/>
                            <separator colspan="4" string="State"/>
                            <field name="state"/>
                        </page>
                        <page string="Daily Meetings">
                            <field colspan="4" name="meetings_id" nolabel="1" widget="one2many_list"/>
                        </page>
                        <page string="Review">
                            <field colspan="4" name="review" nolabel="1"/>
                        </page>
                        <page string="Retrospective">
                            <field colspan="4" name="retrospective" nolabel="1"/>
                        </page>
                    </notebook>
                </form>
            </field>
        </record>
        <record id="action_sprint_form" model="ir.actions.act_window">
            <field name="name">Sprint</field>
            <field name="res_model">scrum.sprint</field>
            <field name="view_type">form</field>
            <field name="view_id" ref="view_scrum_sprint_form"/>
        </record>
        <menuitem action="action_sprint_form" id="menu_action_sprint_form" parent="scrum.next_id_67"/>
        
        <record id="action_sprint_open_tree" model="ir.actions.act_window">
            <field name="name">Opened Sprints</field>
            <field name="res_model">scrum.sprint</field>
            <field name="view_type">tree</field>
            <field name="domain">[('state','=','open')]</field>
        </record>
        <menuitem action="action_sprint_open_tree" id="menu_action_sprint_open_tree" parent="scrum.menu_action_sprint_form"/>
        <record id="action_sprint_open_tree2" model="ir.actions.act_window">
            <field name="name">Draft Sprints</field>
            <field name="res_model">scrum.sprint</field>
            <field name="view_type">tree</field>
            <field name="domain">[('state','=','draft')]</field>
        </record>
        <menuitem action="action_sprint_open_tree2" id="menu_action_sprint_open_tree2" parent="scrum.menu_action_sprint_form"/>
        <record id="action_sprint_open_tree3" model="ir.actions.act_window">
            <field name="name">Sprints Done</field>
            <field name="res_model">scrum.sprint</field>
            <field name="view_type">tree</field>
            <field name="domain">[('state','=','done')]</field>
        </record>
        <menuitem action="action_sprint_open_tree3" id="menu_action_sprint_open_tree3" parent="scrum.menu_action_sprint_form"/>
        
        <record id="action_sprint_open_tree4" model="ir.actions.act_window">
            <field name="name">My Sprints (Product Owner)</field>
            <field name="res_model">scrum.sprint</field>
            <field name="view_type">tree</field>
            <field name="domain">[('product_owner_id','=',uid)]</field>
        </record>
        <menuitem action="action_sprint_open_tree4" id="menu_action_sprint_open_tree4" parent="scrum.menu_action_sprint_form"/>
        <record id="action_sprint_open_tree5" model="ir.actions.act_window">
            <field name="name">My Sprints (Scrum Master)</field>
            <field name="res_model">scrum.sprint</field>
            <field name="view_type">tree</field>
            <field name="domain">[('scrum_master_id','=',uid)]</field>
        </record>
        <menuitem action="action_sprint_open_tree5" id="menu_action_sprint_open_tree5" parent="scrum.menu_action_sprint_form"/>
        
        <record id="action_sprint_open_tree6" model="ir.actions.act_window">
            <field name="name">My opened sprints (Product Owner)</field>
            <field name="res_model">scrum.sprint</field>
            <field name="view_type">tree</field>
            <field name="domain">[('product_owner_id','=',uid),('state','=','open')]</field>
        </record>
        <menuitem action="action_sprint_open_tree6" id="menu_action_sprint_open_tree6" parent="scrum.menu_action_sprint_open_tree4"/>
        <record id="action_sprint_open_tree7" model="ir.actions.act_window">
            <field name="name">My opened sprints (Scrum Master)</field>
            <field name="res_model">scrum.sprint</field>
            <field name="view_type">tree</field>
            <field name="domain">[('scrum_master_id','=',uid),('state','=','open')]</field>
        </record>
        <menuitem action="action_sprint_open_tree7" id="menu_action_sprint_open_tree7" parent="scrum.menu_action_sprint_open_tree5"/>
        
        
        
        <!--
		Daily Meeting
	-->
        
        
        <record id="view_scrum_meeting_tree" model="ir.ui.view">
            <field name="name">scrum.meeting.tree</field>
            <field name="model">scrum.meeting</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Scrum Sprint">
                    <field name="date"/>
                    <field name="name"/>
                    <field name="sprint_id"/>
                </tree>
            </field>
        </record>
        <record id="view_scrum_meeting_form" model="ir.ui.view">
            <field name="name">Scrum Meeting</field>
            <field name="model">scrum.meeting</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Scrum Sprint">
                    <notebook>
                        <page string="Scrum Meeting">
                            <field name="name" select="1"/>
                            <field name="sprint_id"/>
                            <separator colspan="4" string="What have you accomplished since yesterday ?"/>
                            <field colspan="4" name="question_yesterday" nolabel="1"/>
                            <separator colspan="4" string="What are you working on today ?"/>
                            <field colspan="4" name="question_today" nolabel="1"/>
                            <separator colspan="4" string="Is there anything blocking you ?"/>
                            <field colspan="4" name="question_blocks" nolabel="1"/>
                        </page>
                        <page string="Optionnal Info">
                            <field name="date"/>
                            <newline/>
                            <separator colspan="4" string="Are your Sprint Backlog estimate accurate ?"/>
                            <field colspan="4" name="question_backlog" nolabel="1"/>
                        </page>
                    </notebook>
                </form>
            </field>
        </record>
        <record id="action_meeting_form" model="ir.actions.act_window">
            <field name="name">scrum.meeting.form</field>
            <field name="res_model">scrum.meeting</field>
            <field name="view_type">form</field>
            <field name="view_id" ref="view_scrum_meeting_form"/>
        </record>
        <menuitem action="action_meeting_form" id="menu_action_meeting_form" parent="scrum.next_id_67"/>
        
        <!--
	Clicks on a sprint: what a hack
	-->
        
        <record id="action_sprint_task_open" model="ir.actions.act_window">
            <field name="res_model">scrum.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', '=', 'S('+str(active_id)+')')]</field>
        </record>
        <record id="ir_scrum_sprint_open_task" model="ir.values">
            <field eval=" 'tree_but_open'" name="key2"/>
            <field eval="'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">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="'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">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="'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">scrum.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="'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_tree" model="ir.ui.view">
            <field name="name">scrum.task.tree</field>
            <field name="model">scrum.task</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Scrum Tasks">
                    <field name="sequence"/>
                    <field name="name"/>
                    <field name="user_id"/>
                    <field name="priority"/>
                    <field name="date_deadline"/>
                    <field name="progress"/>
                    <field name="planned_hours" sum="Planned hours" widget="float_time"/>
                    <field name="effective_hours" sum="Effective hours" widget="float_time"/>
                    <field name="state"/>
                </tree>
            </field>
        </record>
        
        <record id="view_task_form2" model="ir.ui.view">
            <field name="name">scrum.task.form</field>
            <field name="model">scrum.task</field>
            <field name="type">form</field>
            <field name="inherit_id" ref="project.view_task_form2"/>
            <field name="arch" type="xml">
                <field name="project_id" position="replace">
                    <newline/>
                    	
                    <field name="project_id" required="1" select="1"/>
                    <field domain="[('project_id','=',project_id)]" name="product_backlog_id" select="1"/>
                </field>
            </field>
        </record>
        <record id="action_view_task" model="ir.actions.act_window">
            <field name="name">All Tasks</field>
            <field name="res_model">scrum.task</field>
            <field name="view_type">form</field>
            <field name="domain">[('scrum','=',1)]</field>
        </record>
        <menuitem action="action_view_task" id="menu_action_view_task" parent="scrum.next_id_67"/>
        
        <record id="action_view_task4" model="ir.actions.act_window">
            <field name="name">My tasks</field>
            <field name="res_model">scrum.task</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="domain">[('user_id', '=', uid),('scrum','=',1)]</field>
        </record>
        <menuitem action="action_view_task4" id="menu_action_view_task4" parent="scrum.menu_action_view_task"/>
        
        <record id="action_view_task5" model="ir.actions.act_window">
            <field name="name">My opened tasks</field>
            <field name="res_model">scrum.task</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="domain">[('user_id','=',uid),('state','=','open'),('scrum','=',1)]</field>
        </record>
        <menuitem action="action_view_task5" id="menu_tasks_yours" parent="scrum.menu_action_view_task4"/>
        
        <record id="action_view_task6" model="ir.actions.act_window">
            <field name="name">Opened 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">[('state','=','open'),('scrum','=',1)]</field>
        </record>
        <menuitem action="action_view_task6" id="menu_action_view_task6" parent="project.menu_action_view_task"/>
    </data>
</terp>