<?xml version="1.0" encoding="utf-8"?>
<terp>
    <data>
        <menuitem icon="terp-hr" id="menu_hr_root" name="Human Resources"/>
        <menuitem id="menu_hr_reporting" name="Reporting" parent="hr.menu_hr_root" sequence="40"/>
        <menuitem groups="base.group_admin" id="menu_hr_configuration" name="Configuration" parent="hr.menu_hr_root"/>
        
        <!--
		==========
		Employee 
		==========
		-->
        <record id="view_employee_form" model="ir.ui.view">
            <field name="name">hr.employee.form</field>
            <field name="model">hr.employee</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Employee">
                    <notebook>
                        <page string="Information">
                            <separator colspan="4" string="General Information"/>
                            <field name="name" select="1"/>
                            <field name="company_id"/>
                            <field name="user_id"/>
                            <field name="address_id"/>
                            <field colspan="4" name="notes"/>
                            <separator colspan="4" string="Working Data"/>
                            <field name="regime"/>
                            <field name="active" select="1"/>
                            <field name="holiday_max"/>
                            <field name="started" select="1"/>
                            <field name="parent_id" select="1"/>
                            <field name="category_id"/>
                            <field colspan="4" name="workgroups"/>
                            <field name="state"/>
                            <group col="2" colspan="2">
                                <button name="sign_in" states="absent" string="Sign in !" type="object"/>
                                <button name="sign_out" states="present" string="Sign out !" type="object"/>
                            </group>
                        </page>
                        <page string="Holidays">
                            <field colspan="4" name="holidays" nolabel="1" widget="one2many_list"/>
                        </page>
                    </notebook>
                </form>
            </field>
        </record>
        <record id="view_employee_tree" model="ir.ui.view">
            <field name="name">hr.employee.tree</field>
            <field name="model">hr.employee</field>
            <field name="type">tree</field>
            <field name="field_parent">child_ids</field>
            <field name="arch" type="xml">
                <tree string="Employees">
                    <field name="name"/>
                    <field name="user_id"/>
                    <field name="address_id"/>
                    <field name="state"/>
                </tree>
            </field>
        </record>
        <record id="open_view_employee_tree" model="ir.actions.act_window">
            <field name="name">Employees Structure</field>
            <field name="res_model">hr.employee</field>
            <field name="view_type">tree</field>
            <field name="view_mode">tree,form</field>
            <field name="view_id" ref="view_employee_tree"/>
            <field name="domain">[('parent_id','=',False)]</field>
        </record>
        <menuitem action="open_view_employee_tree" groups="base.group_admin" id="menu_open_view_employee_tree" parent="hr.menu_hr_root"/>
        
        <record id="view_employee_list" model="ir.ui.view">
            <field name="name">hr.employee.tree</field>
            <field name="model">hr.employee</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Employees">
                    <field name="name"/>
                    <field name="user_id"/>
                    <field name="address_id"/>
                    <field name="state"/>
                    <field name="parent_id"/>
                </tree>
            </field>
        </record>
        <record id="open_view_employee_list" model="ir.actions.act_window">
            <field name="name">Employees</field>
            <field name="res_model">hr.employee</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="view_id" ref="view_employee_list"/>
        </record>
        <menuitem action="open_view_employee_list" groups="base.group_admin" id="menu_open_view_employee_list" parent="hr.menu_open_view_employee_tree"/>
        
        <record id="open_view_employee_new" model="ir.actions.act_window">
            <field name="name">New Employee</field>
            <field name="res_model">hr.employee</field>
            <field name="view_type">form</field>
            <field name="view_mode">form,tree</field>
        </record>
        <menuitem action="open_view_employee_new" groups="base.group_admin" id="menu_open_view_employee_new" parent="hr.menu_open_view_employee_tree"/>
        
        
        <!--
		=======================
		Employee architecture
		=======================
		-->
        <record id="view_partner_tree2" model="ir.ui.view">
            <field name="name">hr.employee.tree</field>
            <field name="model">hr.employee</field>
            <field name="type">tree</field>
            <field name="field_parent">child_ids</field>
            <field name="arch" type="xml">
                <tree string="Employees">
                    <field name="name"/>
                    <field name="user_id"/>
                    <field name="address_id"/>
                    <field name="state"/>
                </tree>
            </field>
        </record>
        <record id="action2" model="ir.actions.act_window">
            <field name="name">Hierarchical view of this employee</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">hr.employee</field>
            <field name="domain">[('id','in',active_ids)]</field>
            <field name="view_type">tree</field>
            <field name="view_id" ref="view_partner_tree2"/>
        </record>
        <ir_set>
            <field eval="'action'" name="key"/>
            <field eval="'client_action_multi'" name="key2"/>
            <field eval="['hr.employee']" name="models"/>
            <field name="name">Employees Hierarchy</field>
            <field eval="'ir.actions.act_window,'+str(action2)" name="value"/>
            <field eval="True" name="isobject"/>
            <field eval="True" name="replace"/>
        </ir_set>
        
        
        <!-- 
		============
		Working Time
		============
		-->
        <record id="create_group" model="ir.ui.view">
            <field name="name">hr.timesheet.group.form</field>
            <field name="model">hr.timesheet.group</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Working Time Category">
                    <field name="name" select="1"/>
                    <field name="manager" select="1"/>
                    <newline/>
                    <field colspan="4" name="timesheet_id" nolabel="1" widget="one2many_list"/>
                </form>
            </field>
        </record>
        <record id="edit_workgroup" model="ir.actions.act_window">
            <field name="name">Working Time Categories</field>
            <field name="res_model">hr.timesheet.group</field>
            <field name="view_type">form</field>
            <field name="view_id" eval="False"/>
        </record>
        <menuitem action="edit_workgroup" groups="base.group_admin" id="menu_edit_workgroup" parent="hr.menu_hr_configuration"/>
        
        <record id="view_timesheet_tree" model="ir.ui.view">
            <field name="name">hr.timesheet.tree</field>
            <field name="model">hr.timesheet</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Working Time">
                    <field name="name"/>
                    <field name="dayofweek"/>
                    <field name="hour_from"/>
                    <field name="hour_to"/>
                </tree>
            </field>
        </record>
        <record id="view_timesheet_form" model="ir.ui.view">
            <field name="name">hr.timesheet.form</field>
            <field name="model">hr.timesheet</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Working Time">
                    <field colspan="4" name="name" select="1"/>
                    <field name="date_from"/>
                    <field name="dayofweek" select="1"/>
                    <field name="hour_from"/>
                    <field name="hour_to"/>
                </form>
            </field>
        </record>
        
        <!-- Attendance -->
        <record id="view_attendance_form" model="ir.ui.view">
            <field name="name">hr.attendance.form</field>
            <field name="model">hr.attendance</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Employee attendance">
                    <field name="employee_id" select="1"/>
                    <field colspan="4" name="name" select="1"/>
                    <field name="action" select="1"/>
                    <field name="action_desc" select="1"/>
                </form>
            </field>
        </record>
        <record id="view_attendance_tree" model="ir.ui.view">
            <field name="name">hr.attendance.tree</field>
            <field name="model">hr.attendance</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Employee attendances">
                    <field name="name"/>
                    <field name="action"/>
                    <field name="action_desc"/>
                </tree>
            </field>
        </record>
        
        <record id="view_employee_category_form" model="ir.ui.view">
            <field name="name">hr.employee.category.form</field>
            <field name="model">hr.employee.category</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Employee Category">
                    <field name="name" select="1"/>
                    <field name="parent_id" select="1"/>
                </form>
            </field>
        </record>
        <record id="view_employee_category_list" model="ir.ui.view">
            <field name="name">hr.employee.category.list</field>
            <field name="model">hr.employee.category</field>
            <field name="type">tree</field>
            <field eval="8" name="priority"/>
            <field name="arch" type="xml">
                <tree string="Employees Categories">
                    <field name="name"/>
                    <field name="parent_id"/>
                </tree>
            </field>
        </record>
        <record id="view_employee_category_tree" model="ir.ui.view">
            <field name="name">hr.employee.category.tree</field>
            <field name="model">hr.employee.category</field>
            <field name="type">tree</field>
            <field name="field_parent">child_ids</field>
            <field name="arch" type="xml">
                <tree string="Employees Categories">
                    <field name="name"/>
                </tree>
            </field>
        </record>
        <record id="open_view_categ_form" model="ir.actions.act_window">
            <field name="name">Categories of Employee</field>
            <field name="res_model">hr.employee.category</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
        </record>
        <menuitem action="open_view_categ_form" groups="base.group_admin" id="menu_view_employee_category_form" parent="hr.menu_hr_configuration"/>
        
        <record id="open_view_categ_tree" model="ir.actions.act_window">
            <field name="name">Categories structure</field>
            <field name="res_model">hr.employee.category</field>
            <field name="view_type">tree</field>
            <field name="view_id" ref="view_employee_category_tree"/>
            <field name="domain">[('parent_id','=',False)]</field>
        </record>
        <menuitem action="open_view_categ_tree" groups="base.group_admin" id="menu_view_employee_category_tree" parent="hr.menu_view_employee_category_form"/>
        
        <record id="view_attendance_who" model="ir.ui.view">
            <field name="name">hr.attendance.tree</field>
            <field name="model">hr.attendance</field>
            <field name="type">tree</field>
            <field eval="3" name="priority"/>
            <field name="arch" type="xml">
                <tree string="Employee attendance">
                    <field name="employee_id"/>
                    <field name="name"/>
                    <field name="action"/>
                    <field name="action_desc"/>
                </tree>
            </field>
        </record>
        <record id="open_view_attendance" model="ir.actions.act_window">
            <field name="name">Attendances</field>
            <field name="res_model">hr.attendance</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
        </record>
        <menuitem id="menu_hr_attendance" name="Attendances" parent="hr.menu_hr_root"/>
        <menuitem action="open_view_attendance" groups="base.group_admin" id="menu_open_view_attendance" parent="hr.menu_hr_attendance"/>
        
        
        <!-- Holidays -->
        <record id="edit_holiday" model="ir.ui.view">
            <field name="name">hr.holidays.form</field>
            <field name="model">hr.holidays</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Employee holidays">
                    <field colspan="4" name="name" select="1"/>
                    <field name="date_from" select="1"/>
                    <field name="date_to" select="1"/>
                    <newline/>
                    <field name="holiday_status" select="1"/>
                </form>
            </field>
        </record>
        <record id="view_holiday" model="ir.ui.view">
            <field name="name">hr.holidays.tree</field>
            <field name="model">hr.holidays</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Employee holidays">
                    <field name="name"/>
                    <field name="date_from"/>
                    <field name="date_to"/>
                    <field name="holiday_status"/>
                </tree>
            </field>
        </record>
        
        <record id="ask_holiday" model="ir.ui.view">
            <field name="name">hr.holidays.ask_form</field>
            <field name="model">hr.holidays</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Vacations requests">
                    <field name="name" select="1"/>
                    <field name="holiday_status"/>
                    <field colspan="4" name="employee_id" select="1"/>
                    <newline/>
                    <field name="date_from" select="1"/>
                    <field name="date_to" select="1"/>
                </form>
            </field>
        </record>
        <record id="open_ask_holidays" model="ir.actions.act_window">
            <field name="name">Vacation Requests</field>
            <field name="res_model">hr.holidays</field>
            <field name="view_type">form</field>
            <field name="view_id" ref="view_holiday"/>
        </record>
        <menuitem action="open_ask_holidays" groups="base.group_admin" id="menu_open_ask_holidays" parent="hr.menu_hr_attendance"/>
        
        <!-- Some Configuration (holiday type, attendance reasons) -->
        
        <record id="edit_holiday_status" model="ir.ui.view">
            <field name="name">hr.holidays.status.form</field>
            <field name="model">hr.holidays.status</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Define holiday status">
                    <field colspan="4" name="name" select="1"/>
                </form>
            </field>
        </record>
        <record id="view_holiday_status" model="ir.ui.view">
            <field name="name">hr.holidays.status.tree</field>
            <field name="model">hr.holidays.status</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Holiday status">
                    <field name="name"/>
                </tree>
            </field>
        </record>
        <record id="open_view_holiday_status" model="ir.actions.act_window">
            <field name="name">Holiday Status</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">hr.holidays.status</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="view_id" ref="view_holiday_status"/>
        </record>
        <menuitem action="open_view_holiday_status" groups="base.group_admin" id="menu_open_view_holiday_status" parent="hr.menu_hr_configuration"/>
        
        <record id="edit_attendance_reason" model="ir.ui.view">
            <field name="name">hr.action.reason.form</field>
            <field name="model">hr.action.reason</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Define attendance reason">
                    <field colspan="4" name="name" select="1"/>
                    <field name="action_type" select="1"/>
                </form>
            </field>
        </record>
        <record id="view_attendance_reason" model="ir.ui.view">
            <field name="name">hr.action.reason.tree</field>
            <field name="model">hr.action.reason</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Attendance reasons">
                    <field name="name"/>
                    <field name="action_type"/>
                </tree>
            </field>
        </record>
        <record id="open_view_attendance_reason" model="ir.actions.act_window">
            <field name="name">Attendance Reasons</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">hr.action.reason</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="view_id" ref="view_attendance_reason"/>
        </record>
        <menuitem action="open_view_attendance_reason" groups="base.group_admin" id="menu_open_view_attendance_reason" parent="hr.menu_hr_configuration"/>
        
    </data>
</terp>
