<?xml version="1.0" encoding="utf-8"?>
<terp>
    <data>
        <menuitem id="menu_workflow_root" name="Workflows" parent="menu_custom"/>
        
        <!--
	================================
	Workflows
	================================
	-->
        
        <record id="view_workflow_form" model="ir.ui.view">
            <field name="name">workflow.form</field>
            <field name="model">workflow</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Workflow">
                    <field name="name" select="1"/>
                    <field name="osv" select="1"/>
                    <field name="on_create"/>
                    <separator colspan="4" string="Activities"/>
                    <field colspan="4" name="activities" nolabel="1"/>
                </form>
            </field>
        </record>
        <record id="view_workflow_tree" model="ir.ui.view">
            <field name="name">workflow.tree</field>
            <field name="model">workflow</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Workflow">
                    <field name="name"/>
                    <field name="osv"/>
                    <field name="on_create"/>
                </tree>
            </field>
        </record>
        
        <record id="action_workflow_form" model="ir.actions.act_window">
            <field name="name">Workflows</field>
            <field name="res_model">workflow</field>
            <field name="view_type">form</field>
            <field name="view_id" ref="view_workflow_tree"/>
        </record>
        <menuitem action="action_workflow_form" id="menu_workflow" parent="base.menu_workflow_root"/>
        
        <!--
	================================
	Activities
	================================
	-->
        
        <record id="view_workflow_activity_form" model="ir.ui.view">
            <field name="name">workflow.activity.form</field>
            <field name="model">workflow.activity</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Activity">
                    <field colspan="4" name="name" select="1"/>
                    <field name="wkf_id" select="1"/>
                    <field name="kind" select="1"/>
                    <field name="action" select="1"/>
                    <field name="action_id" select="1"/>
                    <field name="subflow_id"/>
                    <field name="signal_send"/>
                    <newline/>
                    <field name="flow_start"/>
                    <field name="flow_stop"/>
                    <field name="split_mode"/>
                    <field name="join_mode"/>
                    <separator colspan="4" string="Outgoing transitions"/>
                    <field colspan="4" name="out_transitions" nolabel="1">
                        <tree string="Transitions">
                            <field name="act_to"/>
                            <field name="signal"/>
                            <field name="role_id"/>
                            <field name="condition"/>
                            <field name="trigger_model"/>
                            <field name="trigger_expr_id"/>
                            	
                        </tree>
                        	
                    </field>
                    <separator colspan="4" string="Incoming transitions"/>
                    <field colspan="4" name="in_transitions" nolabel="1">
                        <tree string="Transitions">
                            <field name="act_from"/>
                            <field name="signal"/>
                            <field name="role_id"/>
                            <field name="condition"/>
                            <field name="trigger_model"/>
                            <field name="trigger_expr_id"/>
                        </tree>
                    </field>
                </form>
            </field>
        </record>
        <record id="view_workflow_activity_tree" model="ir.ui.view">
            <field name="model">workflow.activity</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Activity">
                    <field name="name"/>
                    <field name="wkf_id"/>
                    <field name="kind"/>
                    <field name="action"/>
                    <field name="action_id"/>
                    <field name="flow_start"/>
                    <field name="flow_stop"/>
                </tree>
            </field>
        </record>
        
        <record id="action_workflow_activity_form" model="ir.actions.act_window">
            <field name="name">Activites</field>
            <field name="res_model">workflow.activity</field>
            <field name="view_type">form</field>
            <field name="view_id" ref="view_workflow_activity_tree"/>
        </record>
        <menuitem action="action_workflow_activity_form" id="menu_workflow_activity" parent="base.menu_workflow_root"/>
        
        
        <!--
	================================
	Transitions
	================================
	-->
        
        <record id="view_workflow_transition_form" model="ir.ui.view">
            <field name="name">workflow.transition.form</field>
            <field name="model">workflow.transition</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Transition">
                    <field name="act_from" select="1"/>
                    <field name="act_to" select="1"/>
                    <field colspan="4" name="condition"/>
                    <field name="signal"/>
                    <field name="role_id"/>
                    <field name="trigger_model"/>
                    <field name="trigger_expr_id"/>
                </form>
            </field>
        </record>
        <record id="view_workflow_transition_tree" model="ir.ui.view">
            <field name="name">workflow.transition.tree</field>
            <field name="model">workflow.transition</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Transition">
                    <field name="act_from"/>
                    <field name="act_to"/>
                    <field name="signal"/>
                    <field name="role_id"/>
                    <field name="condition"/>
                    <field name="trigger_model"/>
                    <field name="trigger_expr_id"/>
                </tree>
            </field>
        </record>
        
        
        <record id="action_workflow_transition_form" model="ir.actions.act_window">
            <field name="name">Transitions</field>
            <field name="res_model">workflow.transition</field>
            <field name="view_type">form</field>
            <field name="view_id" ref="view_workflow_transition_tree"/>
        </record>
        <menuitem action="action_workflow_transition_form" id="menu_workflow_transition" parent="base.menu_workflow_root"/>
        
        <!--
	================================
	Instances
	================================
	-->
        
        <record id="view_workflow_instance_form" model="ir.ui.view">
            <field name="name">workflow.instance.form</field>
            <field name="model">workflow.instance</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Workflow Instances">
                    <field name="wkf_id" select="1"/>
                    <field name="uid" select="2"/>
                    <field name="res_id" select="1"/>
                    <field name="res_type" select="1"/>
                    <field name="state" select="2"/>
                </form>
            </field>
        </record>
        <record id="view_workflow_instance_tree" model="ir.ui.view">
            <field name="name">workflow.instance.tree</field>
            <field name="model">workflow.instance</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Workflow Instances">
                    <field name="wkf_id"/>
                    <field name="uid"/>
                    <field name="res_id"/>
                    <field name="res_type"/>
                    <field name="state"/>
                </tree>
            </field>
        </record>
        
        <record id="action_workflow_instance_form" model="ir.actions.act_window">
            <field name="name">Instances</field>
            <field name="res_model">workflow.instance</field>
            <field name="view_type">form</field>
            <field name="view_id" ref="view_workflow_instance_tree"/>
        </record>
        <menuitem action="action_workflow_instance_form" id="menu_workflow_instance" parent="base.menu_workflow_root"/>
        
        <!--
	================================
	Workitems
	================================
	-->
        
        <record id="view_workflow_workitem_form" model="ir.ui.view">
            <field name="name">workflow.workitem.form</field>
            <field name="model">workflow.workitem</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Workflow Workitems">
                    <field name="act_id" select="1"/>
                    <field name="subflow_id" select="1"/>
                    <field name="inst_id" select="1"/>
                    <field name="state" select="2"/>
                </form>
            </field>
        </record>
        <record id="view_workflow_workitem_tree" model="ir.ui.view">
            <field name="name">workflow.workitem.tree</field>
            <field name="model">workflow.workitem</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Workflow Workitems">
                    <field name="act_id"/>
                    <field name="subflow_id"/>
                    <field name="inst_id"/>
                    <field name="state"/>
                </tree>
            </field>
        </record>
        
        <record id="action_workflow_workitem_form" model="ir.actions.act_window">
            <field name="name">Workitems</field>
            <field name="res_model">workflow.workitem</field>
            <field name="view_type">form</field>
            <field name="view_id" ref="view_workflow_workitem_tree"/>
        </record>
        <menuitem action="action_workflow_workitem_form" id="menu_workflow_workitem" parent="base.menu_workflow_root"/>
        
    </data>
</terp>
