<?xml version="1.0"?>
<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tryton>
    <data>
        <record model="ir.ui.view" id="work_view_tree">
            <field name="model">project.work</field>
            <field name="type">tree</field>
            <field name="priority" eval="20"/>
            <field name="field_childs">children</field>
            <field name="name">work_tree</field>
        </record>

        <record model="ir.ui.view" id="work_view_list">
            <field name="model">project.work</field>
            <field name="type">tree</field>
            <field name="priority" eval="10"/>
            <field name="name">work_list</field>
        </record>

        <record model="ir.ui.view" id="work_view_list2">
            <field name="model">project.work</field>
            <field name="type">tree</field>
            <field name="name">work_list2</field>
        </record>
        <record model="ir.ui.view" id="work_view_form">
            <field name="model">project.work</field>
            <field name="type">form</field>
            <field name="name">work_form</field>
        </record>
        <record model="ir.action.act_window" id="act_work_tree">
            <field name="name">Works Efforts</field>
            <field name="res_model">project.work</field>
            <field name="domain">[('parent', '=', None)]</field>
        </record>
        <record model="ir.action.act_window.view"
            id="act_work_tree_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="work_view_tree"/>
            <field name="act_window" ref="act_work_tree"/>
        </record>
        <record model="ir.action.act_window.view"
            id="act_work_tree_view2">
            <field name="sequence" eval="20"/>
            <field name="view" ref="work_view_form"/>
            <field name="act_window" ref="act_work_tree"/>
        </record>
        <menuitem parent="menu_configuration" action="act_work_tree"
            id="menu_work_tree"/>

        <record model="ir.action.act_window" id="act_work_list">
            <field name="name">Works Efforts</field>
            <field name="res_model">project.work</field>
        </record>
        <record model="ir.action.act_window.view"
            id="act_work_list_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="work_view_list"/>
            <field name="act_window" ref="act_work_list"/>
        </record>
        <record model="ir.action.act_window.view"
            id="act_work_list_view2">
            <field name="sequence" eval="20"/>
            <field name="view" ref="work_view_form"/>
            <field name="act_window" ref="act_work_list"/>
        </record>
        <menuitem parent="menu_work_tree"
            action="act_work_list" id="menu_work_list"/>

        <record model="ir.action.act_window" id="act_project_tree">
            <field name="name">Projects</field>
            <field name="res_model">project.work</field>
            <field name="domain">[('parent', '=', None)]</field>
        </record>
        <record model="ir.action.act_window.view"
            id="act_project_tree_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="work_view_tree"/>
            <field name="act_window" ref="act_project_tree"/>
        </record>
        <record model="ir.action.act_window.view"
            id="act_project_tree_view2">
            <field name="sequence" eval="20"/>
            <field name="view" ref="work_view_form"/>
            <field name="act_window" ref="act_project_tree"/>
        </record>
        <menuitem parent="menu_project" action="act_project_tree"
            id="menu_project_tree"/>

        <record model="ir.action.act_window" id="act_project_form">
            <field name="name">Projects</field>
            <field name="res_model">project.work</field>
            <field name="domain">[('type', '=', 'project')]</field>
            <field name="context"></field>
        </record>
        <record model="ir.action.act_window.view"
            id="act_project_form_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="work_view_list2"/>
            <field name="act_window" ref="act_project_form"/>
        </record>
        <record model="ir.action.act_window.view"
            id="act_project_form_view2">
            <field name="sequence" eval="20"/>
            <field name="view" ref="work_view_form"/>
            <field name="act_window" ref="act_project_form"/>
        </record>
        <menuitem parent="menu_project_tree" action="act_project_form"
            id="menu_project_form"/>

        <record model="ir.action.act_window" id="act_task_form">
            <field name="name">Tasks</field>
            <field name="res_model">project.work</field>
            <field name="domain">[('type', '=', 'task')]</field>
            <field name="context"></field>
        </record>
        <record model="ir.action.act_window.view"
            id="act_task_form_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="work_view_list2"/>
            <field name="act_window" ref="act_task_form"/>
        </record>
        <record model="ir.action.act_window.view"
            id="act_task_form_view2">
            <field name="sequence" eval="20"/>
            <field name="view" ref="work_view_form"/>
            <field name="act_window" ref="act_task_form"/>
        </record>
        <menuitem parent="menu_project_tree" action="act_task_form"
            id="menu_task_form"/>

        <record model="ir.action.act_window" id="act_open_child_work">
            <field name="name">Tasks</field>
            <field name="res_model">project.work</field>
            <field name="context"></field>
            <field name="domain">[('parent', 'in', Eval('active_ids')), ('type', '=', 'task')]</field>
        </record>
        <record model="ir.action.keyword"
                id="act_open_project_work_keyword1">
            <field name="keyword">form_relate</field>
            <field name="model">project.work,-1</field>
            <field name="action" ref="act_open_child_work"/>
        </record>
        <record model="ir.action.act_window.view"
            id="act_open_project_view1">
            <field name="sequence" eval="10"/>
            <field name="view" ref="work_view_list2"/>
            <field name="act_window" ref="act_open_child_work"/>
        </record>
        <record model="ir.action.act_window.view"
            id="act_open_project_view2">
            <field name="sequence" eval="20"/>
            <field name="view" ref="work_view_form"/>
            <field name="act_window" ref="act_open_child_work"/>
        </record>

        <record model="ir.model.access" id="access_work">
            <field name="model" search="[('model', '=', 'project.work')]"/>
            <field name="perm_read" eval="True"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_delete" eval="False"/>
        </record>
        <record model="ir.model.access" id="access_work_admin">
            <field name="model" search="[('model', '=', 'project.work')]"/>
            <field name="group" ref="group_project_admin"/>
            <field name="perm_read" eval="True"/>
            <field name="perm_write" eval="True"/>
            <field name="perm_create" eval="True"/>
            <field name="perm_delete" eval="True"/>
        </record>

    </data>
</tryton>
