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