add message_followers_ids
[odoo/odoo.git] / addons / hr_holidays / hr_holidays_view.xml
1 <openerp>
2     <data>
3
4         <!-- Hr holidays Read/Unread actions -->
5         <record id="actions_server_holidays_unread" model="ir.actions.server">
6             <field name="name">Mark unread</field>
7             <field name="condition">True</field>
8             <field name="type">ir.actions.server</field>
9             <field name="model_id" ref="model_hr_holidays"/>
10             <field name="state">code</field>
11             <field name="code">self.message_check_and_set_unread(cr, uid, context.get('active_ids'), context=context)</field>
12         </record>
13         <record id="action_holidays_unread" model="ir.values">
14             <field name="name">action_holidays_unread</field>
15             <field name="action_id" ref="actions_server_holidays_unread"/>
16             <field name="value" eval="'ir.actions.server,' + str(ref('actions_server_holidays_unread'))" />
17             <field name="key">action</field>
18             <field name="model_id" ref="model_hr_holidays" />
19             <field name="model">hr.holidays</field>
20             <field name="key2">client_action_multi</field>
21         </record>
22
23         <record id="actions_server_holidays_read" model="ir.actions.server">
24             <field name="name">Mark read</field>
25             <field name="condition">True</field>
26             <field name="type">ir.actions.server</field>
27             <field name="model_id" ref="model_hr_holidays"/>
28             <field name="state">code</field>
29             <field name="code">self.message_check_and_set_read(cr, uid, context.get('active_ids'), context=context)</field>
30         </record>
31         <record id="action_holidays_read" model="ir.values">
32             <field name="name">action_holidays_read</field>
33             <field name="action_id" ref="actions_server_holidays_read"/>
34             <field name="value" eval="'ir.actions.server,' + str(ref('actions_server_holidays_read'))" />
35             <field name="key">action</field>
36             <field name="model_id" ref="model_hr_holidays" />
37             <field name="model">hr.holidays</field>
38             <field name="key2">client_action_multi</field>
39         </record>
40
41         <record id="view_hr_holidays_filter" model="ir.ui.view">
42             <field name="name">hr.holidays.filter</field>
43             <field name="model">hr.holidays</field>
44             <field name="arch" type="xml">
45                 <search string="Search Leave">
46                     <field name="date_from"/>
47                     <filter icon="terp-mail-message-new" string="Inbox" help="Unread messages" name="needaction_pending" domain="[('needaction_pending','=',True)]"/>
48                     <separator/>
49                     <filter icon="terp-check" domain="[('state','=','draft')]" string="To Confirm"/>
50                     <filter icon="terp-camera_test" domain="[('state','=','confirm')]" string="To Approve" name="approve"/>
51                     <filter icon="terp-camera_test" domain="[('state','=','validate')]" string="Validated" name="validated"/>
52                     <separator/>
53                     <filter icon="terp-go-year" name="year" string="Year" domain="[('holiday_status_id.active','=',True)]" help="Filters only on allocations and requests that belong to an holiday type that is 'active' (active field is True)"/>
54                     <separator/>
55                     <filter string="My Leaves" icon="terp-personal" name="my_leaves" domain="[('employee_id.user_id','=', uid)]" help="My Leaves"/>
56                     <separator/>
57                     <filter string="My Department Leaves" icon="terp-personal+" help="My Department Leaves" domain="[('department_id.manager_id','=',uid)]"/>
58                     <field name="employee_id"/>
59                     <field name="department_id"/>
60                     <field name="holiday_status_id"/>
61                     <group expand="0" string="Group By...">
62                         <filter name="group_date_from" string="Start Date" icon="terp-personal" domain="[]" context="{'group_by':'date_from'}"/>
63                         <filter name="group_employee" string="Employee" icon="terp-personal" domain="[]" context="{'group_by':'employee_id'}"/>
64                         <filter name="group_category" string="Category" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'category_id'}"/>
65                         <filter string="Manager" icon="terp-personal" domain="[]" context="{'group_by':'manager_id'}"/>
66                         <filter string="Department" icon="terp-personal+" domain="[]" context="{'group_by':'department_id','set_visible':True}"/>
67                         <filter name="group_type" string="Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'holiday_status_id'}"/>
68                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
69                     </group>
70                 </search>
71             </field>
72         </record>
73
74         <!-- Holidays: Leave Request -->
75
76         <record id="view_holiday_new_calendar" model="ir.ui.view">
77             <field name="name">Leave Request</field>
78             <field name="model">hr.holidays</field>
79             <field name="arch" type="xml">
80                 <calendar string="Leave Request" color="user_id" date_start="date_from" date_stop="date_to">
81                     <field name="user_id"/>
82                     <field name="holiday_status_id"/>
83                 </calendar>
84             </field>
85         </record>
86
87         <record model="ir.ui.view" id="edit_holiday_new">
88             <field name="name">Leave Request</field>
89             <field name="model">hr.holidays</field>
90             <field name="priority">1</field>
91             <field name="arch" type="xml">
92                 <form string="Leave Request" version="7.0">
93                 <header>
94                     <button string="Submit to Manager" name="confirm" states="draft" type="workflow" class="oe_highlight"/>
95                     <button string="Approve" name="validate" states="confirm" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
96                     <button string="Validate" name="second_validate" states="validate1" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
97                     <button string="Refuse" name="refuse" states="confirm,validate1" type="workflow" groups="base.group_hr_user,base.group_hr_manager" class="oe_highlight"/>
98                     <button string="Reset to New" name="set_to_draft" states="refuse,validate" type="object" groups="base.group_hr_user" />
99                     <field name="state" widget="statusbar" statusbar_visible="draft,confirm,validate" statusbar_colors='{"confirm":"blue","validate1":"blue","refuse":"red"}'/>
100                 </header>
101                 <sheet string="Leave Request">
102                     <group>
103                         <group>
104                             <field name="name" attrs="{'readonly':[('state','!=','draft'),('state','!=','confirm')]}"/>
105                             <field name="holiday_type" on_change="onchange_type(holiday_type)" attrs="{'readonly':[('state','!=','draft')]}" width="130" string="Mode" groups="base.group_hr_user"/>
106                             <field name="employee_id" attrs="{'required':[('holiday_type','=','employee')],'invisible':[('holiday_type','=','category')]}" groups="base.group_hr_user"/>
107                             <field name="category_id" attrs="{'required':[('holiday_type','=','category')], 'invisible':[('holiday_type','=','employee')], 'readonly':[('state','!=','draft'), ('state','!=','confirm')]}"/>
108                             <field name="department_id" attrs="{'readonly':[('holiday_type','=','category')]}" groups="base.group_hr_user"/>
109                         </group>
110                         <group>
111                             <field name="holiday_status_id" on_change="onchange_status_id(holiday_status_id)" context="{'employee_id':employee_id}"/>
112                             <label for="number_of_days_temp" string="Duration"/>
113                             <div>
114                                 <field name="date_from" on_change="onchange_date_from(date_to, date_from)" required="1" class="oe_inline"/> - 
115                                 <field name="date_to" on_change="onchange_date_from(date_to, date_from)" required="1" class="oe_inline"/>
116                                 <div>
117                                     <field name="number_of_days_temp" class="oe_inline"/> days
118                                 </div>
119                             </div>
120                         </group>
121                     </group>
122                     <notebook colspan="4">
123                         <page string="General">
124                             <group>
125                                 <group>
126                                     <field name="manager_id" groups="base.group_no_one"/>
127                                     <field name="double_validation" invisible="1"/>
128                                 </group>
129                                 <group>
130                                     <field name="manager_id2" attrs="{'invisible':[('double_validation', '!=', True)]}" groups="base.group_no_one"/>
131                                 </group>
132                             </group>
133                             <newline/>
134                             <field name="notes" nolabel="1" colspan="4" placeholder="Add a reason..."/>
135                         </page>
136                     </notebook>
137                 </sheet>
138                 <div class="oe_chatter">
139                     <field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
140                     <field name="message_follower_ids" widget="mail_followers"/>
141                 </div>
142                 </form>
143             </field>
144         </record>
145
146         <!-- Holidays: Allocation Request -->
147         <record model="ir.ui.view" id="allocation_leave_new">
148             <field name="name">Allocation Request</field>
149             <field name="model">hr.holidays</field>
150             <field name="arch" type="xml">
151                 <form string="Allocation Request" version="7.0">
152                 <header>
153                     <button string="Submit to Manager" name="confirm" states="draft" type="workflow" class="oe_highlight"/>
154                     <button string="Approve" name="validate" states="confirm" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
155                     <button string="Validate" name="second_validate" states="validate1" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
156                     <button string="Refuse" name="refuse" states="confirm,validate1" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
157                     <button string="Reset to New" name="set_to_draft" states="cancel,validate,refuse" type="object" groups="base.group_hr_user" />
158                     <field name="state" widget="statusbar" statusbar_visible="draft,confirm,validate" statusbar_colors='{"confirm":"blue","validate1":"blue","refuse":"red"}'/>
159                 </header>
160                 <sheet>
161                     <group>
162                         <group>
163                             <field name="name"/>
164                             <field name="holiday_type" on_change="onchange_type(holiday_type)" attrs="{'readonly':[('state','!=','draft')]}" string="Allocation Mode" groups="base.group_hr_manager"/>
165                             <field name="employee_id" attrs="{'required':[('holiday_type','=','employee')], 'invisible':[('holiday_type','=','category')]}"/>
166                             <field name="category_id" attrs="{'required':[('holiday_type','=','category')], 'readonly':[('state','!=','draft')], 'invisible':[('holiday_type','=','employee')]}"/>
167                             <field name="department_id" attrs="{'readonly':['|', ('holiday_type','=','category'), ('state','not in' ,('draft', 'confirm'))]}"/>
168                         </group>
169                         <group>
170                             <field name="holiday_status_id" on_change="onchange_status_id(holiday_status_id)" context="{'employee_id':employee_id}"/>
171                             <field name="number_of_days_temp"/>
172                         </group>
173                     </group>
174                     <notebook>
175                         <page string="General">
176                             <group col="4">
177                                 <field name="double_validation" invisible="1"/>
178                                 <field name="manager_id"/>
179                                 <field name="manager_id2" attrs="{'invisible':[('double_validation', '!=', True)]}"/>
180                             </group>
181                             <field name="notes" placeholder="Add a reason..."/>
182                         </page>
183                     </notebook>
184                 </sheet>
185                 <div class="oe_chatter">
186                     <field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
187                     <field name="message_follower_ids" widget="mail_followers"/>
188                 </div>
189                 </form>
190             </field>
191         </record>
192
193         <record model="ir.ui.view" id="view_holiday_allocation_tree">
194             <field name="name">hr.holidays.allocation.tree</field>
195             <field name="model">hr.holidays</field>
196             <field name="arch" type="xml">
197                 <tree fonts="bold:needaction_pending==True" colors="red:state == 'refuse';blue:state == 'draft';black:state in ('confirm','validate','validate1')" string="Allocation Requests">
198                     <field name="needaction_pending" invisible="1"/>
199                     <field name="employee_id"/>
200                     <field name="holiday_type"/>
201                     <field name="category_id"/>
202                     <field name="department_id" invisible="1"/>
203                     <field name="holiday_status_id"/>
204                     <field name="name"/>
205                     <field name="number_of_days" string="Number of Days" sum="Remaining Days"/>
206                     <field name="manager_id" invisible="1"/>
207                     <field name="user_id" invisible="1"/>
208                     <!--field name="type"/-->
209                     <field name="state"/>
210                 </tree>
211             </field>
212         </record>
213
214         <!-- Holidays: Leaves Management -->
215         <record model="ir.ui.view" id="allocation_company_new">
216             <field name="name">Leaves Management</field>
217             <field name="model">hr.holidays</field>
218             <field name="arch" type="xml">
219                 <form string="Leaves Management" version="7.0">
220                     <header>
221                         <button string="Submit to Manager" name="confirm" states="draft" type="workflow" icon="gtk-yes"/>
222                         <button string="Approve" name="validate" states="confirm" type="workflow" icon="gtk-apply"/>
223                         <button string="Refuse" name="refuse" states="confirm,validate,draft" type="workflow" icon="gtk-no"/>
224                         <button string="Reset to New" name="set_to_draft" states="cancel" type="object" icon="gtk-convert"/>
225                         <field name="state"/>
226                     </header>
227                     <group col="4">
228                         <field name="name"/>
229                         <field name="holiday_status_id"/>
230                         <field name="type"/>
231                         <field name="date_from" on_change="onchange_date_from(date_to, date_from)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
232                         <field name="date_to" on_change="onchange_date_from(date_to, date_from)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
233                         <field name="number_of_days_temp"/>
234                         <field name="manager_id"/>
235                     </group>
236                     <field name="notes"/>
237                 </form>
238             </field>
239         </record>
240
241         <record model="ir.ui.view" id="view_holiday_simple">
242             <field name="name">hr.holidays.report_tree</field>
243             <field name="model">hr.holidays</field>
244             <field name="priority">20</field>
245             <field name="arch" type="xml">
246                 <tree fonts="bold:needaction_pending==True" colors="red:state == 'refuse';blue:state == ' draft';black:state in ('confirm','validate','validate1')" string="Leaves Summary">
247                     <field name="needaction_pending" invisible="1"/>
248                     <field name="employee_id"/>
249                     <field name="category_id" invisible="1"/>
250                     <field name="department_id" invisible="1"/>
251                     <field name="type"/>
252                     <field name="name"/>
253                     <field name="number_of_days" string="Number of Days" sum="Remaining Days"/>
254                     <field name="date_from"/>
255                     <field name="date_to"/>
256                     <field name="holiday_status_id"/>
257                     <field name="manager_id" invisible="1"/>
258                     <field name="user_id" invisible="1"/>
259                     <field name="state"/>
260                 </tree>
261             </field>
262         </record>
263
264
265         <record model="ir.ui.view" id="view_holiday">
266             <field name="name">hr.holidays.tree</field>
267             <field name="model">hr.holidays</field>
268             <field name="arch" type="xml">
269                 <tree fonts="bold:needaction_pending==True" colors="red:state == 'refuse';blue:state == ' draft';black:state in ('confirm','validate','validate1')" string="Leave Requests">
270                     <field name="needaction_pending" invisible="1"/>
271                     <field name="employee_id"/>
272                     <field name="holiday_type" string="Mode" groups="base.group_hr_user"/>
273                     <field name="name"/>
274                     <field name="date_from"/>
275                     <field name="date_to"/>
276                     <field name="number_of_days" string="Number of Days" sum="Remaining Days"/>
277                     <field name="state"/>
278                     <field name="category_id" invisible="1"/>
279                     <field name="department_id" invisible="not context.get('set_visible',False)"/>
280                     <field name="holiday_status_id" invisible="1"/>
281                     <field name="manager_id" invisible="1"/>
282                     <field name="user_id" invisible="1"/>
283                     <!--field name="type"/-->
284                 </tree>
285             </field>
286         </record>
287
288         <menuitem name="Leaves" parent="hr.menu_hr_root" id="menu_open_ask_holidays" sequence="20"/>
289
290         <record model="ir.actions.act_window" id="open_ask_holidays">
291             <field name="name">Leave Requests</field>
292             <field name="res_model">hr.holidays</field>
293             <field name="view_type">form</field>
294             <field name="view_id" ref="edit_holiday_new"/>
295             <field name="context">{}</field>
296             <field name="domain">[('type','=','remove')]</field>
297             <field name="search_view_id" ref="view_hr_holidays_filter"/>
298             <field name="help" type="html">
299               <p class="oe_view_nocontent_create">
300                 Click to create a new leave request. 
301               </p><p>
302                 Once you have recorded your leave request, it will be sent
303                 to a manager for validation. Be sure to set the right leave
304                 type (recuperation, legal holidays, sickness) and the exact
305                 number of open days related to your leave.
306               </p>
307             </field>
308         </record>
309
310         <record model="ir.actions.act_window.view" id="action_open_ask_holidays_tree">
311             <field name="sequence" eval="2"/>
312             <field name="view_mode">tree</field>
313             <field name="view_id" ref="view_holiday"/>
314             <field name="act_window_id" ref="open_ask_holidays"/>
315         </record>
316
317         <record model="ir.actions.act_window.view" id="action_open_ask_holidays_form">
318             <field name="sequence" eval="3"/>
319             <field name="view_mode">form</field>
320             <field name="view_id" ref="edit_holiday_new"/>
321             <field name="act_window_id" ref="open_ask_holidays"/>
322         </record>
323
324         <record model="ir.actions.act_window.view" id="action_open_ask_holidays_calendar">
325             <field name="sequence" eval="1"/>
326             <field name="view_mode">calendar</field>
327             <field name="view_id" ref="view_holiday_new_calendar"/>
328             <field name="act_window_id" ref="open_ask_holidays"/>
329         </record>
330
331         <menuitem name="My Leave Requests" parent="menu_open_ask_holidays" id="menu_open_ask_holidays_new" action="open_ask_holidays"/>
332
333         <record model="ir.actions.act_window" id="request_approve_holidays">
334             <field name="name">Requests Approve</field>
335             <field name="res_model">hr.holidays</field>
336             <field name="view_type">form</field>
337             <field name="context">{'default_type': 'remove', 'search_default_approve':1}</field>
338             <field name="domain">[('type','=','remove')]</field>
339             <field name="view_id" ref="edit_holiday_new"/>
340             <field name="search_view_id" ref="view_hr_holidays_filter"/>
341         </record>
342
343         <record model="ir.actions.act_window.view" id="action_request_approve_holidays_tree">
344             <field name="sequence" eval="1"/>
345             <field name="view_mode">tree</field>
346             <field name="view_id" ref="view_holiday"/>
347             <field name="act_window_id" ref="request_approve_holidays"/>
348         </record>
349
350         <record model="ir.actions.act_window.view" id="action_request_approve_holidays_form">
351             <field name="sequence" eval="2"/>
352             <field name="view_mode">form</field>
353             <field name="view_id" ref="edit_holiday_new"/>
354             <field name="act_window_id" ref="request_approve_holidays"/>
355         </record>
356
357         <menuitem name="Leave Requests to Approve" parent="menu_open_ask_holidays" id="menu_request_approve_holidays" action="request_approve_holidays" groups="base.group_hr_user"/>
358
359         <record model="ir.actions.act_window" id="open_allocation_holidays">
360             <field name="name">Allocation Requests</field>
361             <field name="res_model">hr.holidays</field>
362             <field name="view_type">form</field>
363             <field name="context">{'default_type':'add'}</field>
364             <field name="domain">[('type','=','add')]</field>
365             <field name="view_id" ref="allocation_leave_new"/>
366             <field name="search_view_id" ref="view_hr_holidays_filter"/>
367         </record>
368
369         <record model="ir.actions.act_window.view" id="action_open_allocation_holidays_tree">
370             <field name="sequence" eval="1"/>
371             <field name="view_mode">tree</field>
372             <field name="view_id" ref="view_holiday_allocation_tree"/>
373             <field name="act_window_id" ref="open_allocation_holidays"/>
374         </record>
375
376         <record model="ir.actions.act_window.view" id="action_open_allocation_holidays_form">
377             <field name="sequence" eval="2"/>
378             <field name="view_mode">form</field>
379             <field name="view_id" ref="allocation_leave_new"/>
380             <field name="act_window_id" ref="open_allocation_holidays"/>
381         </record>
382
383         <menuitem name="Allocation Requests" parent="menu_open_ask_holidays" id="menu_open_allocation_holidays" action="open_allocation_holidays"/>
384
385         <record model="ir.actions.act_window" id="open_company_allocation">
386             <field name="name">Leaves Summary</field>
387             <field name="res_model">hr.holidays</field>
388             <field name="view_type">form</field>
389             <field name="view_mode">tree,form</field>
390             <field name="view_id" eval="view_holiday_simple"/>
391             <field name="context">{'search_default_group_type': 1, 'search_default_validated': 1}</field>
392             <field name="domain">[('holiday_type','=','employee')]</field>
393             <field name="search_view_id" ref="view_hr_holidays_filter"/>
394         </record>
395
396         <menuitem name="Leaves Summary" parent="menu_open_ask_holidays" id="menu_open_company_allocation" action="open_company_allocation" sequence="40"/>
397
398         <!-- holidays status -->
399         <record id="view_holidays_status_filter" model="ir.ui.view">
400             <field name="name">hr.holidays.status.filter</field>
401             <field name="model">hr.holidays.status</field>
402             <field name="arch" type="xml">
403                 <search string="Search Leave Type">
404                     <field name="name" string="Leave Types"/>
405                     <field name="categ_id"/>
406                 </search>
407             </field>
408         </record>
409
410         <record model="ir.ui.view" id="edit_holiday_status_form">
411             <field name="name">hr.holidays.status.form</field>
412             <field name="model">hr.holidays.status</field>
413             <field name="arch" type="xml">
414                 <form string="Leave Type" version="7.0">
415                     <group col="4">
416                         <field name="name"/>
417                         <field name="categ_id"/>
418                     </group>
419                     <notebook>
420                       <page string="Details">
421                           <group>
422                               <group name="selection" string="Validation">
423                                   <field name="double_validation"/>
424                                   <field name="limit"/>
425                               </group>
426                               <group name="second" string="Misc">
427                                   <field name="color_name"/>
428                                   <field name="active"/>
429                               </group>
430                           </group>
431                       </page>
432                     </notebook>
433                 </form>
434             </field>
435         </record>
436
437         <record model="ir.ui.view" id="view_holiday_status_tree">
438             <field name="name">hr.holidays.status.tree</field>
439             <field name="model">hr.holidays.status</field>
440             <field name="arch" type="xml">
441                 <tree string="Leave Type">
442                     <field name="name"/>
443                     <field name="max_leaves"/>
444                     <field name="leaves_taken"/>
445                     <field name="remaining_leaves"/>
446                 </tree>
447             </field>
448         </record>
449         <record model="ir.ui.view" id="view_holiday_status_normal_tree">
450             <field name="name">hr.holidays.status.normal.tree</field>
451             <field name="model">hr.holidays.status</field>
452             <field name="priority">35</field>
453             <field name="arch" type="xml">
454                 <tree string="Leave Type">
455                     <field name="name"/>
456                     <field name="limit"/>
457                 </tree>
458             </field>
459         </record>
460
461         <record id="view_hr_holidays_status_search" model="ir.ui.view">
462             <field name="name">hr.holidays.status.search</field>
463             <field name="model">hr.holidays.status</field>
464             <field name="arch" type="xml">
465                 <search string="Leave Type">
466                     <field name="name" string="Leave Types"/>
467                     <field name="categ_id"/>
468                 </search>
469             </field>
470         </record>
471
472         <record id="open_view_holiday_status" model="ir.actions.act_window">
473             <field name="name">Leave Type</field>
474             <field name="type">ir.actions.act_window</field>
475             <field name="res_model">hr.holidays.status</field>
476             <field name="view_type">form</field>
477             <field name="view_mode">tree,form</field>
478             <field name="view_id" eval="view_holiday_status_normal_tree"/>
479             <field name="search_view_id" ref="view_hr_holidays_status_search"/>
480         </record>
481
482         <menuitem sequence="3" id="hr.menu_open_view_attendance_reason_config" parent="hr.menu_hr_configuration" name="Leaves"/>
483         <menuitem name="Leave Type" action="open_view_holiday_status" id="menu_open_view_holiday_status" parent="hr.menu_hr_configuration" sequence="10" />
484
485     <!-- holiday on resource leave -->
486         <record id="resource_calendar_leave_form_inherit" model="ir.ui.view">
487             <field name="name">resource.calendar.leaves.form.inherit</field>
488             <field name="model">resource.calendar.leaves</field>
489             <field name="inherit_id" ref="resource.resource_calendar_leave_form"/>
490             <field name="arch" type="xml">
491                 <field name="name" position="after">
492                     <field name="holiday_id"/>
493                 </field>
494             </field>
495         </record>
496
497     <!--  Shortcuts -->
498         <record id="act_hr_employee_holiday_request" model="ir.actions.act_window">
499             <field name="name">Leaves</field>
500             <field name="type">ir.actions.act_window</field>
501             <field name="res_model">hr.holidays</field>
502             <field name="src_model">hr.employee</field>
503             <field name="view_type">form</field>
504             <field name="view_mode">tree,form</field>
505             <field name="context">{'search_default_employee_id': [active_id], 'default_employee_id': active_id}</field>
506             <field name="domain">[('type','=','remove')]</field>
507             <field name="view_id" eval="view_holiday"/>
508         </record>
509
510        <!--  Assing leave       -->
511
512         <record id="hr_holidays_leaves_assign_tree_view" model="ir.ui.view">
513             <field name="name">hr.employee.leave.tree</field>
514             <field name="model">hr.employee</field>
515             <field name="arch" type="xml">
516                 <tree string="Assign Leaves" editable="bottom">
517                     <field name="name" string="Employee"/>
518                     <field name="remaining_leaves" string="Remaining Legal Leaves"/>
519                 </tree>
520             </field>
521         </record>
522
523         <record model="ir.actions.act_window" id="hr_holidays_leaves_assign_legal">
524            <field name="name">Allocate Leaves for Employees</field>
525            <field name="type">ir.actions.act_window</field>
526            <field name="res_model">hr.employee</field>
527            <field name="view_type">form</field>
528            <field name="view_mode">tree,form</field>
529            <field name="view_id" ref="hr_holidays_leaves_assign_tree_view"/>
530            <field name="help" type="html">
531              <p>
532                You can assign remaining Legal Leaves for each employee, OpenERP
533                will automatically create and validate allocation requests.
534              </p>
535            </field>
536        </record>
537
538         <!-- Hr employee inherit Legal Leaves -->
539
540         <record id="view_employee_form_leave_inherit" model="ir.ui.view">
541             <field name="name">hr.employee.leave.form.inherit</field>
542             <field name="model">hr.employee</field>
543             <field name="inherit_id" ref="hr.view_employee_form"/>
544             <field name="arch" type="xml">
545                 <field name="active" position="before">
546                     <label for="remaining_leaves"/>
547                     <div>
548                         <field name="remaining_leaves" class="oe_inline"/>
549                         <button name="%(act_hr_employee_holiday_request)d" string="Leaves" type="action" class="oe_inline oe_right"/>
550                     </div>
551                 </field>
552             </field>
553         </record>
554
555         <record model="ir.ui.view" id="hr_kanban_view_employees_kanban">
556             <field name="name">HR - Employees Kanban with leave status</field>
557             <field name="model">hr.employee</field>
558             <field name="inherit_id" ref="hr.hr_kanban_view_employees"/>
559             <field name="arch" type="xml">
560                 <xpath expr="//templates" position="before">
561                     <field name="current_leave_id"/>
562                     <field name="current_leave_state"/>
563                     <field name="leave_date_from"/>
564                     <field name="leave_date_to"/>
565                 </xpath>
566                 <xpath expr="//div[@class='oe_employee_details']/ul/li[@id='last_login']" position="inside">
567                     <span t-if="record.current_leave_id.raw_value" style="font-size: 100%%"
568                             t-att-class="record.current_leave_state.raw_value=='validate'?'oe_kanban_button oe_kanban_color_3':'oe_kanban_button oe_kanban_color_2'"
569                             t-att-title="record.leave_date_from.raw_value.toString('ddd dS MMM') + ' - ' + record.leave_date_to.raw_value.toString('ddd dS MMM')">
570                         <field name="current_leave_id"/>
571                     </span>
572                 </xpath>
573             </field>
574         </record>
575
576         <act_window
577             id="act_hr_leave_request_to_meeting"
578             name="Leave Meetings"
579             src_model="hr.holidays"
580             res_model="crm.meeting"
581             view_mode="tree,form,calendar,gantt"
582             view_type="form"/>
583
584     </data>
585 </openerp>