<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <record id="wkf_payment_order" model="workflow">
            <field name="name">Payment Order Workflow</field>
            <field name="osv">payment.order</field>
            <field name="on_create">True</field>
        </record>
        <!--Activity -->
        <record id="act_draft" model="workflow.activity">
            <field name="name">draft</field>
            <field name="wkf_id" ref="wkf_payment_order"/>
            <field name="flow_start">True</field>
            <field name="action">write({'state':'draft'})</field>
            <field name="kind">function</field>
        </record>
        <record id="act_open" model="workflow.activity">
            <field name="name">open</field>
            <field name="wkf_id" ref="wkf_payment_order"/>
            <field name="action">action_open()
write({'state':'open'})</field>
            <field name="kind">function</field>
        </record>
        <record id="act_done" model="workflow.activity">
            <field name="name">done</field>
            <field name="wkf_id" ref="wkf_payment_order"/>
            <field name="action">write({'state':'done'})</field>
            <field name="kind">function</field>
            <field name="flow_stop">True</field>
        </record>
        <record id="act_cancel" model="workflow.activity">
            <field name="name">cancel</field>
            <field name="wkf_id" ref="wkf_payment_order"/>
            <field name="action">write({'state':'cancel'})</field>
            <field name="kind">function</field>
            <field name="flow_stop">True</field>
        </record>

        <!-- Transition -->
        <record id="trans_draft_open" model="workflow.transition">
            <field name="act_from" ref="act_draft"/>
            <field name="act_to" ref="act_open"/>
            <field name="signal">open</field>
        </record>

        <record id="trans_open_done" model="workflow.transition">
            <field name="act_from" ref="act_open"/>
            <field name="act_to" ref="act_done"/>
            <field name="signal">done</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">cancel</field>
        </record>
        <record id="trans_open_cancel" model="workflow.transition">
            <field name="act_from" ref="act_open"/>
            <field name="act_to" ref="act_cancel"/>
            <field name="signal">cancel</field>
        </record>

    </data>
</openerp>
