<?xml version="1.0" ?>
<terp>
	<data>

		<!-- Roles definition -->

		<record model="res.roles" id="HR">
			<field name="name">Human Resources</field>
		</record>

		<!-- Workflow definition -->

		<record model="workflow" id="wkf_expenses">
			<field name="name">hr.wkf.expenses</field>
			<field name="osv">hr.expense</field>
			<field name="on_create">True</field>
		</record>

		<record model="workflow.activity" id="act_draft">
			<field name="wkf_id" ref="wkf_expenses" />
			<field name="name">draft</field>
			<field name="flow_start">True</field>
		</record>
		<record model="workflow.activity" id="act_confirm">
			<field name="wkf_id" ref="wkf_expenses" />
			<field name="name">confirm</field>
			<field name="kind">function</field>
			<field name="action">write({'state':'confirm'})</field>
		</record>
		<record model="workflow.activity" id="act_accepted">
			<field name="wkf_id" ref="wkf_expenses" />
			<field name="name">accepted</field>
			<field name="kind">function</field>
			<field name="action">write({'state':'accepted'})</field>
			<field name="flow_stop">True</field>
		</record>
		<record model="workflow.activity" id="act_refused">
			<field name="wkf_id" ref="wkf_expenses" />
			<field name="name">refused</field>
			<field name="kind">function</field>
			<field name="action">write({'state':'refused'})</field>
			<field name="flow_stop">True</field>
		</record>

		<record model="workflow.transition" id="t1">
			<field name="act_from" ref="act_draft" />
			<field name="act_to" ref="act_accepted" />
			<field name="condition">amount &lt; 200</field>
		</record>
		<record model="workflow.transition" id="t2">
			<field name="act_from" ref="act_draft" />
			<field name="act_to" ref="act_confirm" />
			<field name="condition">amount &gt;= 200</field>
		</record>
		<record model="workflow.transition" id="t3">
			<field name="act_from" ref="act_confirm" />
			<field name="act_to" ref="act_accepted" />
			<field name="signal">accept</field>
			<field name="role_id" ref="HR"/>
		</record>
		<record model="workflow.transition" id="t4">
			<field name="act_from" ref="act_confirm" />
			<field name="act_to" ref="act_refused" />
			<field name="signal">refuse</field>
			<field name="role_id" ref="HR"/>
		</record>
	</data>
</terp>
