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

		<!-- Roles definition -->

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

		<!-- Workflow definition -->

		<record model="workflow" id="wkf_expenses">
			<field name="name">hr.wkf.expenses</field>
			<field name="osv">hr.expense.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">expense_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">expense_accept()</field>
		</record>
		<record model="workflow.activity" id="act_paid">
			<field name="wkf_id" ref="wkf_expenses" />
			<field name="name">paid</field>
			<field name="kind">function</field>
			<field name="action">expense_paid()</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">expense_canceled()</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_confirm" />
			<field name="signal">confirm</field>
		</record>
		<record model="workflow.transition" id="t2">
			<field name="act_from" ref="act_confirm" />
			<field name="act_to" ref="act_accepted" />
			<field name="signal">validate</field>
			<field name="role_id" ref="HR"/>
		</record>
		<record model="workflow.transition" id="t3">
			<field name="act_from" ref="act_accepted" />
			<field name="act_to" ref="act_paid" />
			<field name="signal">paid</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>
		<record model="workflow.transition" id="t5">
			<field name="act_from" ref="act_draft" />
			<field name="act_to" ref="act_refused" />
			<field name="signal">refuse</field>
		</record>

		<record model="workflow.transition" id="t6">
			<field name="act_from" ref="act_accepted" />
			<field name="act_to" ref="act_refused" />
			<field name="signal">refuse</field>
			<field name="role_id" ref="HR"/>
		</record>
		<record model="workflow.transition" id="t7">
			<field name="act_from" ref="act_confirm" />
			<field name="act_to" ref="act_draft" />
			<field name="signal">draft</field>
			<field name="role_id" ref="HR"/>
		</record>
	</data>
</terp>
