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

        <record id="wkf_picking" model="workflow">
            <field name="name">stock.picking.basic</field>
            <field name="osv">stock.picking</field>
            <field name="on_create">True</field>
        </record>
        <record id="act_draft" model="workflow.activity">
            <field name="wkf_id" ref="wkf_picking"/>
            <field name="flow_start">True</field>
            <field name="name">draft</field>
        </record>
        <record id="act_confirmed" model="workflow.activity">
            <field name="wkf_id" ref="wkf_picking"/>
            <field name="name">confirmed</field>
            <field name="kind">function</field>
            <field name="action">action_confirm()</field>
        </record>
        <record id="act_assigned" model="workflow.activity">
            <field name="wkf_id" ref="wkf_picking"/>
            <field name="name">assigned</field>
            <field name="kind">function</field>
            <field name="action">action_assign_wkf()</field>
        </record>
        <record id="act_move" model="workflow.activity">
            <field name="wkf_id" ref="wkf_picking"/>
            <field name="name">move</field>
            <field name="kind">function</field>
            <field name="action">action_move()</field>
        </record>
        <record id="act_done" model="workflow.activity">
            <field name="wkf_id" ref="wkf_picking"/>
            <field name="name">done</field>
            <field name="kind">function</field>
            <field name="action">action_done()</field>
            <field name="flow_stop">True</field>
        </record>
        <record id="act_cancel_inv" model="workflow.activity">
            <field name="wkf_id" ref="wkf_picking"/>
            <field name="name">cancel</field>
            <field name="flow_stop">True</field>
            <field name="kind">function</field>
            <field name="action">action_cancel()</field>
        </record>

        <record id="act_cancel" model="workflow.activity">
            <field name="wkf_id" ref="wkf_picking"/>
            <field name="name">cancel</field>
            <field name="flow_stop">True</field>
            <field name="kind">function</field>
            <field name="action">action_cancel()</field>
        </record>

        <record id="trans_draft_confirmed" model="workflow.transition">
            <field name="act_from" ref="act_draft"/>
            <field name="act_to" ref="act_confirmed"/>
            <field name="signal">button_confirm</field>
        </record>
        <record id="trans_confirmed_assigned_back" model="workflow.transition">
            <field name="act_from" ref="act_assigned"/>
            <field name="act_to" ref="act_confirmed"/>
            <field name="condition">not test_assigned()</field>
        </record>
        <record id="trans_confirmed_assigned" model="workflow.transition">
            <field name="act_from" ref="act_confirmed"/>
            <field name="act_to" ref="act_assigned"/>
            <field name="condition">test_assigned()</field>
        </record>
        <record id="trans_assigned_move_done" model="workflow.transition">
            <field name="act_from" ref="act_assigned"/>
            <field name="act_to" ref="act_move"/>
            <field name="condition">test_done()</field>
        </record>
        <record id="trans_assigned_move" model="workflow.transition">
            <field name="act_from" ref="act_assigned"/>
            <field name="act_to" ref="act_move"/>
            <field name="condition">auto_picking and test_auto_picking()</field>
        </record>
        <record id="trans_assigned_move2" model="workflow.transition">
            <field name="act_from" ref="act_assigned"/>
            <field name="act_to" ref="act_move"/>
            <field name="signal">button_done</field>
        </record>
        <record id="trans_move_done" model="workflow.transition">
            <field name="act_from" ref="act_move"/>
            <field name="act_to" ref="act_done"/>
            <field name="condition">test_finnished()</field>
        </record>
        <record id="trans_move_confirmed" model="workflow.transition">
            <field name="act_from" ref="act_move"/>
            <field name="act_to" ref="act_confirmed"/>
            <field name="condition">not test_finnished()</field>
        </record>
        <record id="trans_assigned_cancel" model="workflow.transition">
            <field name="act_from" ref="act_assigned"/>
            <field name="act_to" ref="act_cancel"/>
            <field name="signal">button_cancel</field>
        </record>
        <record id="trans_confirmed_cancel" model="workflow.transition">
            <field name="act_from" ref="act_confirmed"/>
            <field name="act_to" ref="act_cancel"/>
            <field name="signal">button_cancel</field>
        </record>
        <record id="trans_draft_cancel" model="workflow.transition">
            <field name="act_from" ref="act_draft"/>
            <field name="act_to" ref="act_cancel"/>
            <field name="signal">button_cancel</field>
        </record>

        <record id="trans_assigned_cancel_auto" model="workflow.transition">
            <field name="act_from" ref="act_assigned"/>
            <field name="act_to" ref="act_cancel"/>
            <field name="condition">test_cancel()</field>
        </record>
        <record id="trans_confirmed_cancel_auto" model="workflow.transition">
            <field name="act_from" ref="act_confirmed"/>
            <field name="act_to" ref="act_cancel"/>
            <field name="condition">test_cancel()</field>
        </record>
        <record id="trans_draft_cancel" model="workflow.transition">
            <field name="act_from" ref="act_draft"/>
            <field name="act_to" ref="act_cancel_inv"/>
            <field name="signal">button_cancel</field>
        </record>

        <record id="trans_assigned_cancel_auto" model="workflow.transition">
            <field name="act_from" ref="act_assigned"/>
            <field name="act_to" ref="act_cancel"/>
            <field name="condition">test_cancel()</field>
        </record>
        <record id="trans_confirmed_cancel_auto" model="workflow.transition">
            <field name="act_from" ref="act_confirmed"/>
            <field name="act_to" ref="act_cancel"/>
            <field name="condition">test_cancel()</field>
        </record>

    </data>
</openerp>
