forked from OCA/hr
-
Notifications
You must be signed in to change notification settings - Fork 8
/
hr_schedule_workflow.xml
162 lines (136 loc) · 6.78 KB
/
hr_schedule_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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Schedule Workflow Definition -->
<record id="wkf_schedule" model="workflow">
<field name="name">hr.schedule.basic</field>
<field name="osv">hr.schedule</field>
<field name="on_create">True</field>
</record>
<!-- Workflow Activities (Stages) -->
<record id="act_draft" model="workflow.activity">
<field name="wkf_id" ref="wkf_schedule"/>
<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_validate" model="workflow.activity">
<field name="wkf_id" ref="wkf_schedule"/>
<field name="name">confirmed</field>
<field name="kind">function</field>
<field name="action">workflow_validate()</field>
</record>
<record id="act_locked" model="workflow.activity">
<field name="wkf_id" ref="wkf_schedule"/>
<field name="name">locked</field>
<field name="kind">function</field>
<field name="action">workflow_lock()</field>
</record>
<record id="act_unlocked" model="workflow.activity">
<field name="wkf_id" ref="wkf_schedule"/>
<field name="name">unlocked</field>
<field name="kind">function</field>
<field name="action">workflow_unlock()</field>
</record>
<!-- Workflow Transitions -->
<record id="draft2validate" model="workflow.transition">
<field name="act_from" ref="act_draft"/>
<field name="act_to" ref="act_validate"/>
<field name="signal">signal_validate</field>
<field name="group_id" ref="hr.group_hr_manager"/>
</record>
<record id="draft2locked" model="workflow.transition">
<field name="act_from" ref="act_draft"/>
<field name="act_to" ref="act_locked"/>
<field name="condition">details_locked() == True</field>
<field name="signal">signal_lock</field>
<field name="group_id" ref="hr.group_hr_manager"/>
</record>
<record id="validate2locked" model="workflow.transition">
<field name="act_from" ref="act_validate"/>
<field name="act_to" ref="act_locked"/>
<field name="condition">details_locked() == True</field>
<field name="signal">signal_lock</field>
<field name="group_id" ref="hr.group_hr_manager"/>
</record>
<record id="locked2unlocked" model="workflow.transition">
<field name="act_from" ref="act_locked"/>
<field name="act_to" ref="act_unlocked"/>
<field name="condition">details_locked() == False</field>
<field name="signal">signal_unlock</field>
<field name="group_id" ref="hr.group_hr_manager"/>
</record>
<record id="unlocked2locked" model="workflow.transition">
<field name="act_from" ref="act_unlocked"/>
<field name="act_to" ref="act_locked"/>
<field name="condition">details_locked() == True</field>
<field name="signal">signal_lock</field>
<field name="group_id" ref="hr.group_hr_manager"/>
</record>
<!-- Schedule Detail -->
<!-- Schedule Detail Workflow Definition -->
<record id="wkf_schedule_detail" model="workflow">
<field name="name">hr.schedule.detail.basic</field>
<field name="osv">hr.schedule.detail</field>
<field name="on_create">True</field>
</record>
<!-- Workflow Activities (Stages) -->
<record id="act_detdraft" model="workflow.activity">
<field name="wkf_id" ref="wkf_schedule_detail"/>
<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_detvalidate" model="workflow.activity">
<field name="wkf_id" ref="wkf_schedule_detail"/>
<field name="name">confirmed</field>
<field name="kind">function</field>
<field name="action">write({'state': 'validate'})</field>
</record>
<record id="act_detlocked" model="workflow.activity">
<field name="wkf_id" ref="wkf_schedule_detail"/>
<field name="name">locked</field>
<field name="kind">function</field>
<field name="action">workflow_lock()</field>
</record>
<record id="act_detunlocked" model="workflow.activity">
<field name="wkf_id" ref="wkf_schedule_detail"/>
<field name="name">unlocked</field>
<field name="kind">function</field>
<field name="action">workflow_unlock()</field>
</record>
<!-- Workflow Transitions -->
<record id="det_draft2validate" model="workflow.transition">
<field name="act_from" ref="act_detdraft"/>
<field name="act_to" ref="act_detvalidate"/>
<field name="signal">signal_validate</field>
<field name="group_id" ref="hr.group_hr_manager"/>
</record>
<record id="det_draft2locked" model="workflow.transition">
<field name="act_from" ref="act_detdraft"/>
<field name="act_to" ref="act_detlocked"/>
<field name="signal">signal_lock</field>
<field name="group_id" ref="hr.group_hr_manager"/>
</record>
<record id="det_validate2locked" model="workflow.transition">
<field name="act_from" ref="act_detvalidate"/>
<field name="act_to" ref="act_detlocked"/>
<field name="signal">signal_lock</field>
<field name="group_id" ref="hr.group_hr_manager"/>
</record>
<record id="det_locked2unlocked" model="workflow.transition">
<field name="act_from" ref="act_detlocked"/>
<field name="act_to" ref="act_detunlocked"/>
<field name="signal">signal_unlock</field>
<field name="group_id" ref="hr.group_hr_manager"/>
</record>
<record id="det_unlocked2locked" model="workflow.transition">
<field name="act_from" ref="act_detunlocked"/>
<field name="act_to" ref="act_detlocked"/>
<field name="signal">signal_lock</field>
<field name="group_id" ref="hr.group_hr_manager"/>
</record>
</data>
</openerp>