-
Notifications
You must be signed in to change notification settings - Fork 0
/
hr_contract_init_workflow.xml
61 lines (51 loc) · 2.39 KB
/
hr_contract_init_workflow.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Workflow Definition -->
<record id="wkf_contract_init" model="workflow">
<field name="name">hr.contract.init.basic</field>
<field name="osv">hr.contract.init</field>
<field name="on_create">True</field>
</record>
<!-- Workflow Activities (Stages) -->
<record id="act_draft" model="workflow.activity">
<field name="wkf_id" ref="wkf_contract_init"/>
<field name="name">draft</field>
<field name="kind">function</field>
<field name="action">write({'state': 'draft'})</field>
<field name="flow_start">True</field>
</record>
<record id="act_approve" model="workflow.activity">
<field name="wkf_id" ref="wkf_contract_init"/>
<field name="name">approve</field>
<field name="kind">function</field>
<field name="action">state_approve()</field>
</record>
<record id="act_decline" model="workflow.activity">
<field name="wkf_id" ref="wkf_contract_init"/>
<field name="name">decline</field>
<field name="kind">function</field>
<field name="action">state_decline()</field>
<field name="flow_stop">True</field>
</record>
<!-- Workflow Transitions -->
<record id="draft2approve" model="workflow.transition">
<field name="act_from" ref="act_draft"/>
<field name="act_to" ref="act_approve"/>
<field name="signal">signal_approve</field>
<field name="group_id" ref="hr_security.group_hr_director"/>
</record>
<record id="draft2decline" model="workflow.transition">
<field name="act_from" ref="act_draft"/>
<field name="act_to" ref="act_decline"/>
<field name="signal">signal_decline</field>
<field name="group_id" ref="hr_security.group_hr_director"/>
</record>
<record id="approve2decline" model="workflow.transition">
<field name="act_from" ref="act_approve"/>
<field name="act_to" ref="act_decline"/>
<field name="signal">signal_decline</field>
<field name="group_id" ref="hr_security.group_hr_director"/>
</record>
</data>
</openerp>