forked from OCA/hr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hr_transfer_workflow.xml
100 lines (85 loc) · 4.21 KB
/
hr_transfer_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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?xml version="1.0" encoding="utf-8" ?>
<openerp>
<data>
<!-- Workflow Definition -->
<record id="wkf_department_transfer" model="workflow">
<field name="name">hr.department.transfer.basic</field>
<field name="osv">hr.department.transfer</field>
<field name="on_create">True</field>
</record>
<!-- Workflow Activities (States) -->
<record id="act_draft" model="workflow.activity">
<field name="wkf_id" ref="wkf_department_transfer"/>
<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_confirm" model="workflow.activity">
<field name="wkf_id" ref="wkf_department_transfer"/>
<field name="name">confirm</field>
<field name="kind">function</field>
<field name="action">state_confirm()</field>
</record>
<record id="act_pending" model="workflow.activity">
<field name="wkf_id" ref="wkf_department_transfer"/>
<field name="name">pending</field>
<field name="kind">function</field>
<field name="action">write({'state': 'pending'})</field>
</record>
<record id="act_done" model="workflow.activity">
<field name="wkf_id" ref="wkf_department_transfer"/>
<field name="name">done</field>
<field name="kind">function</field>
<field name="action">state_done()</field>
<field name="flow_stop">True</field>
</record>
<record id="act_cancel" model="workflow.activity">
<field name="wkf_id" ref="wkf_department_transfer"/>
<field name="name">cancel</field>
<field name="kind">function</field>
<field name="action">write({'state': 'cancel'})</field>
<field name="flow_stop">True</field>
</record>
<!-- Workflow Transitions -->
<record id="draft2confirm" model="workflow.transition">
<field name="act_from" ref="act_draft"/>
<field name="act_to" ref="act_confirm"/>
<field name="signal">signal_confirm</field>
<field name="group_id" ref="base.group_hr_user"/>
</record>
<record id="confirm2pending" model="workflow.transition">
<field name="act_from" ref="act_confirm"/>
<field name="act_to" ref="act_pending"/>
<field name="condition">effective_date_in_future()</field>
<field name="signal">signal_pending</field>
<field name="group_id" ref="base.group_hr_manager"/>
</record>
<record id="confirm2done" model="workflow.transition">
<field name="act_from" ref="act_confirm"/>
<field name="act_to" ref="act_done"/>
<field name="condition">not effective_date_in_future()</field>
<field name="signal">signal_pending</field>
<field name="group_id" ref="base.group_hr_manager"/>
</record>
<record id="confirm2cancel" model="workflow.transition">
<field name="act_from" ref="act_confirm"/>
<field name="act_to" ref="act_cancel"/>
<field name="signal">signal_cancel</field>
<field name="group_id" ref="base.group_hr_manager"/>
</record>
<record id="pending2done" model="workflow.transition">
<field name="act_from" ref="act_pending"/>
<field name="act_to" ref="act_done"/>
<field name="condition">not effective_date_in_future()</field>
<field name="signal">signal_done</field>
<field name="group_id" ref="base.group_hr_manager"/>
</record>
<record id="pending2cancel" model="workflow.transition">
<field name="act_from" ref="act_pending"/>
<field name="act_to" ref="act_cancel"/>
<field name="signal">signal_cancel</field>
<field name="group_id" ref="base.group_hr_manager"/>
</record>
</data>
</openerp>