367 lines
19 KiB
XML
367 lines
19 KiB
XML
<?xml version="1.0" ?>
|
|
<openerp>
|
|
<data>
|
|
<record id="view_hr_holidays_filter" model="ir.ui.view">
|
|
<field name="name">hr.holidays.filter</field>
|
|
<field name="model">hr.holidays</field>
|
|
<field name="type">search</field>
|
|
<field name="arch" type="xml">
|
|
<search string="Search Leave">
|
|
<group col='8' colspan='4'>
|
|
<filter icon="terp-hr" domain="[('state','=','draft')]" string="To Confirm"/>
|
|
<filter icon="terp-hr" domain="[('state','=','confirm')]" string="To Validate"/>
|
|
<filter icon="terp-hr" domain="[('state','=','validate')]" string="Validated"
|
|
default="context.get('report', False)"/>
|
|
<separator orientation="vertical"/>
|
|
<field name="user_id" widget="selection" default="uid"/>
|
|
<field name="department_id" widget="selection">
|
|
<filter icon="terp-hr"
|
|
domain="[('department_id.manager_id','=',uid)]"
|
|
/>
|
|
</field>
|
|
<field name="holiday_status_id" widget="selection"/>
|
|
</group>
|
|
<newline />
|
|
<group expand="1" string="Group By..." colspan="11" col="11">
|
|
<filter string="Department" icon="terp-sale" domain="[]" context="{'group_by':'department_id'}"/>
|
|
<filter string="Manager" icon="terp-sale" domain="[]" context="{'group_by':'manager_id'}"/>
|
|
<filter string="User" icon="terp-sale" domain="[]" context="{'group_by':'user_id'}"/>
|
|
<separator orientation="vertical"/>
|
|
<filter string="State" icon="terp-sale" domain="[]" context="{'group_by':'state'}"/>
|
|
<filter string="Type" icon="terp-sale" domain="[]" context="{'group_by':'holiday_status_id'}"
|
|
default="context.get('report', False)"/>
|
|
</group>
|
|
</search>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Holidays: Leave Request -->
|
|
<record model="ir.ui.view" id="edit_holiday_new">
|
|
<field name="name">Leave Request</field>
|
|
<field name="model">hr.holidays</field>
|
|
<field name="type">form</field>
|
|
<field name="priority">1</field>
|
|
<field name="arch" type="xml">
|
|
<form string="Leave Request">
|
|
<group col="6" colspan="4">
|
|
<field name="name" select="1"/>
|
|
<field name="holiday_type" on_change="onchange_type(holiday_type)" attrs="{'readonly':[('state','!=','draft')]}"/>
|
|
</group>
|
|
<notebook colspan="4">
|
|
<page string="General">
|
|
<group colspan="4" attrs="{'invisible':[('holiday_type','=','employee')]}">
|
|
<field name="category_id" select="1" attrs="{'required':[('holiday_type','=','category')], 'readonly':[('state','!=','draft')]}"/>
|
|
</group>
|
|
<group colspan="4" attrs="{'invisible':[('holiday_type','=','category')]}">
|
|
<field name="employee_id" select="1" attrs="{'required':[('holiday_type','=','employee')]}"/>
|
|
</group>
|
|
<field name="holiday_status_id" select="1" on_change="onchange_sec_id(holiday_status_id)" context="{'employee_id':employee_id}" />
|
|
<newline/>
|
|
<field name="date_from" select="1" on_change="onchange_date_from(date_to, date_from)" required="1"/>
|
|
<field name="date_to" select="1" on_change="onchange_date_to(date_from, date_to)" required="1"/>
|
|
<field name="number_of_days_temp"/>
|
|
<field name="manager_id"/>
|
|
<field name="department_id"/>
|
|
<field name="notes" colspan="4"/>
|
|
<newline/>
|
|
<field name="state" select="1" colspan="2"/>
|
|
<group colspan="2">
|
|
<button string="Confirm" name="confirm" states="draft" type="workflow" icon="gtk-yes"/>
|
|
<button string="Validate" name="validate" states="confirm" type="workflow" icon="gtk-apply"/>
|
|
<button string="Approve" name="second_validate" states="validate1" type="workflow" icon="gtk-apply"/>
|
|
<button string="Refuse" name="refuse" states="confirm,validate1" type="workflow" icon="gtk-no"/>
|
|
<button string="Cancel" name="cancel" states="validate,refuse" type="workflow" icon="gtk-cancel"/>
|
|
<button string="Set to Draft" name="set_to_draft" states="cancel" type="object" icon="gtk-convert"/>
|
|
</group>
|
|
</page>
|
|
<page string="Extra Information">
|
|
<field name="manager_id2"/>
|
|
</page>
|
|
</notebook>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Holidays: Allocation Request -->
|
|
<record model="ir.ui.view" id="allocation_leave_new">
|
|
<field name="name">Allocation Request</field>
|
|
<field name="model">hr.holidays</field>
|
|
<field name="type">form</field>
|
|
<field name="arch" type="xml">
|
|
<form string="Allocation Request">
|
|
<field name="name" select="1"/>
|
|
<field name="holiday_status_id" select="1" />
|
|
<field name="holiday_type" on_change="onchange_type(holiday_type)" attrs="{'readonly':[('state','!=','draft')]}" string="Allocation Type"/>
|
|
<notebook colspan="4">
|
|
<page string="General">
|
|
<group colspan="4" attrs="{'invisible':[('holiday_type','=','employee')]}">
|
|
<field name="category_id" select="1" attrs="{'required':[('holiday_type','=','category')], 'readonly':[('state','!=','draft')]}"/>
|
|
</group>
|
|
<group colspan="4" attrs="{'invisible':[('holiday_type','=','category')]}">
|
|
<field name="employee_id" select="1" attrs="{'required':[('holiday_type','=','employee')]}"/>
|
|
</group>
|
|
<field name="department_id"/>
|
|
<field name="number_of_days_temp"/>
|
|
<field name="manager_id"/>
|
|
<field name="notes" colspan="4"/>
|
|
<newline/>
|
|
<field name="state" select="1" colspan="2"/>
|
|
<group colspan="2">
|
|
<button string="Confirm" name="confirm" states="draft" type="workflow" icon="gtk-yes"/>
|
|
<button string="Validate" name="validate" states="confirm" type="workflow" icon="gtk-apply"/>
|
|
<button string="Approve" name="second_validate" states="validate1" type="workflow" icon="gtk-apply"/>
|
|
<button string="Refuse" name="refuse" states="confirm,validate1" type="workflow" icon="gtk-no"/>
|
|
<button string="Cancel" name="cancel" states="validate,refuse" type="workflow" icon="gtk-cancel"/>
|
|
<button string="Set to Draft" name="set_to_draft" states="cancel" type="object" icon="gtk-convert"/>
|
|
</group>
|
|
</page>
|
|
<page string="Extra Information">
|
|
<field name="manager_id2"/>
|
|
</page>
|
|
</notebook>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Holidays: Leaves Management -->
|
|
<record model="ir.ui.view" id="allocation_company_new">
|
|
<field name="name">Leaves Management</field>
|
|
<field name="model">hr.holidays</field>
|
|
<field name="type">form</field>
|
|
<field name="arch" type="xml">
|
|
<form string="Leaves Management">
|
|
<field name="name" select="1"/>
|
|
<field name="holiday_status_id" select="1"/>
|
|
<!-- <field name="holiday_type"/>
|
|
<field name="category_id" select="1" required="1"/>
|
|
--> <field name="employee_id" select="1" />
|
|
<!--<field name="department_id"/>-->
|
|
<field name="type"/>
|
|
<field name="date_from" select="1" on_change="onchange_date_from(date_to, date_from)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
|
|
<field name="date_to" select="1" on_change="onchange_date_to(date_from, date_to)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
|
|
<field name="number_of_days_temp"/>
|
|
<notebook colspan="4">
|
|
<page string="General">
|
|
<field name="manager_id"/>
|
|
<field name="notes" colspan="4"/>
|
|
<newline/>
|
|
<field name="state" select="1" colspan="2"/>
|
|
<group colspan="2">
|
|
<button string="Confirm" name="confirm" states="draft" type="workflow" icon="gtk-yes"/>
|
|
<button string="Validate" name="validate" states="confirm" type="workflow" icon="gtk-apply"/>
|
|
<button string="Refuse" name="refuse" states="confirm" type="workflow" icon="gtk-no"/>
|
|
<button string="Cancel" name="cancel" states="validate,refuse,validate1" type="workflow" icon="gtk-cancel"/>
|
|
<button string="Set to Draft" name="set_to_draft" states="cancel" type="object" icon="gtk-convert"/>
|
|
</group>
|
|
</page>
|
|
</notebook>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<record model="ir.ui.view" id="view_holiday_simple">
|
|
<field name="name">hr.holidays.reprot_tree</field>
|
|
<field name="model">hr.holidays</field>
|
|
<field name="type">tree</field>
|
|
<field name="priority">20</field>
|
|
<field name="arch" type="xml">
|
|
<tree string="Holidays Report">
|
|
<field name="employee_id" invisible="1"/>
|
|
<field name="department_id" invisible="1"/>
|
|
<field name="number_of_days" string="Number of Days" sum='Remaining Days'/>
|
|
<field name="date_from" invisible="1"/>
|
|
<field name="date_to" invisible="1"/>
|
|
<field name="name" invisible="1"/>
|
|
<field name="holiday_status_id" invisible="1"/>
|
|
<field name="type" invisible="1"/>
|
|
<field name="state" invisible="1"/>
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
|
|
|
|
<record model="ir.ui.view" id="view_holiday">
|
|
<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="Leaves"
|
|
colors="red:state == 'refuse';grey:state == 'cancel'">
|
|
<field name="employee_id"/>
|
|
<field name="department_id"/>
|
|
<field name="number_of_days" string="Number of Days" sum='Remaining Days'/>
|
|
<field name="date_from"/>
|
|
<field name="date_to"/>
|
|
<field name="name"/>
|
|
<field name="holiday_status_id"/>
|
|
<field name="type"/>
|
|
<field name="state"/>
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- My leave dashboard -->
|
|
<!-- <record model="ir.ui.view" id="view_my_leave_board_form">
|
|
<field name="name">hr.holidays.per.user.form</field>
|
|
<field name="model">hr.holidays.per.user</field>
|
|
<field name="type">form</field>
|
|
<field name="arch" type="xml">
|
|
<form string="My Leaves" >
|
|
<field name="employee_id"/>
|
|
<field name="user_id"/>
|
|
<field name="holiday_status"/>
|
|
<field name="max_leaves"/>
|
|
<field name="leaves_taken" />
|
|
<field name="remaining_leaves"/>
|
|
<field name="notes" colspan="4"/>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
-->
|
|
<menuitem
|
|
name="Holidays Management"
|
|
parent="hr.menu_hr_root"
|
|
id="menu_open_ask_holidays"/>
|
|
|
|
<record model="ir.actions.act_window" id="open_ask_holidays">
|
|
<field name="name">Leave Requests</field>
|
|
<field name="res_model">hr.holidays</field>
|
|
<field name="view_type">form</field>
|
|
<field name="view_id" ref="edit_holiday_new"/>
|
|
<field name="domain">[('type','=','remove')]</field>
|
|
<field name="search_view_id" ref="view_hr_holidays_filter"/>
|
|
</record>
|
|
|
|
<record model="ir.actions.act_window.view" id="action_open_ask_holidays_tree">
|
|
<field name="sequence" eval="1"/>
|
|
<field name="view_mode">tree</field>
|
|
<field name="view_id" ref="view_holiday"/>
|
|
<field name="act_window_id" ref="open_ask_holidays"/>
|
|
</record>
|
|
|
|
<record model="ir.actions.act_window.view" id="action_open_ask_holidays_form">
|
|
<field name="sequence" eval="2"/>
|
|
<field name="view_mode">form</field>
|
|
<field name="view_id" ref="edit_holiday_new"/>
|
|
<field name="act_window_id" ref="open_ask_holidays"/>
|
|
</record>
|
|
|
|
|
|
<menuitem
|
|
name="Leave Requests"
|
|
parent="menu_open_ask_holidays"
|
|
id="menu_open_ask_holidays_new"
|
|
action="open_ask_holidays"/>
|
|
|
|
<record model="ir.actions.act_window" id="open_allocation_holidays">
|
|
<field name="name">Allocation Requests</field>
|
|
<field name="res_model">hr.holidays</field>
|
|
<field name="view_type">form</field>
|
|
<field name="context">{'type':'add'}</field>
|
|
<field name="domain">[('type','=','add')]</field>
|
|
<field name="view_id" ref="allocation_leave_new" />
|
|
</record>
|
|
|
|
<record model="ir.actions.act_window.view" id="action_open_allocation_holidays_tree">
|
|
<field name="sequence" eval="1"/>
|
|
<field name="view_mode">tree</field>
|
|
<field name="view_id" ref="view_holiday"/>
|
|
<field name="act_window_id" ref="open_allocation_holidays"/>
|
|
</record>
|
|
|
|
<record model="ir.actions.act_window.view" id="action_open_allocation_holidays_form">
|
|
<field name="sequence" eval="2"/>
|
|
<field name="view_mode">form</field>
|
|
<field name="view_id" ref="allocation_leave_new"/>
|
|
<field name="act_window_id" ref="open_allocation_holidays"/>
|
|
</record>
|
|
|
|
|
|
<menuitem
|
|
name="Allocation Requests"
|
|
parent="menu_open_ask_holidays"
|
|
id="menu_open_allocation_holidays"
|
|
action="open_allocation_holidays"/>
|
|
|
|
<record model="ir.actions.act_window" id="open_company_allocation">
|
|
<field name="res_model">hr.holidays</field>
|
|
<field name="view_type">form</field>
|
|
<field name="view_mode">tree,form</field>
|
|
<field name="view_id" eval="view_holiday_simple" />
|
|
<field name="context">{'allocation_type':'company', 'report':True}</field>
|
|
</record>
|
|
|
|
<menuitem
|
|
name="Leaves Summary"
|
|
parent="menu_open_ask_holidays"
|
|
id="menu_open_company_allocation"
|
|
action="open_company_allocation"
|
|
groups="hr.group_hr_manager"
|
|
sequence="40"/>
|
|
|
|
<!-- holidays status -->
|
|
<record model="ir.ui.view" id="edit_holiday_status_form">
|
|
<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="Leave Type">
|
|
<field colspan="4" name="name" select="1"/>
|
|
<field name="limit"/>
|
|
<field name="active"/>
|
|
<field name="categ_id" select="1" widget="selection"/>
|
|
<field name="color_name"/>
|
|
<field name="double_validation" />
|
|
</form>
|
|
</field>
|
|
</record>
|
|
<record model="ir.ui.view" id="view_holiday_status_tree">
|
|
<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="Leave Type">
|
|
<field name="name"/>
|
|
<field name="remaining_leaves"/>
|
|
<field name="limit" />
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
<record id="open_view_holiday_status" model="ir.actions.act_window">
|
|
<field name="name">Leaves Type</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>
|
|
</record>
|
|
|
|
<menuitem sequence="9" id="hr.menu_open_view_attendance_reason_config" parent="hr.menu_hr_configuration" name="Leaves"/>
|
|
<menuitem name="Leaves Statuses"
|
|
action="open_view_holiday_status"
|
|
id="menu_open_view_holiday_status"
|
|
parent="hr.menu_open_view_attendance_reason_config"/>
|
|
|
|
<!-- holiday on resource leave -->
|
|
<record id="resource_calendar_leave_form_inherit" model="ir.ui.view">
|
|
<field name="name">resource.calendar.leaves.form.inherit</field>
|
|
<field name="model">resource.calendar.leaves</field>
|
|
<field name="type">form</field>
|
|
<field name="inherit_id" ref="resource.resource_calendar_leave_form"/>
|
|
<field name="arch" type="xml">
|
|
<field name="resource_id" on_change="onchange_resource(resource_id)" position="after">
|
|
<field name="holiday_id"/>
|
|
</field>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Shortcuts -->
|
|
<act_window name="Holidays"
|
|
domain="[('employee_id', '=', active_id), ('type','=','remove')]"
|
|
res_model="hr.holidays"
|
|
src_model="hr.employee"
|
|
view_id ="eval('edit_holiday_new')"
|
|
id="act_hr_employee_holiday_request"/>
|
|
|
|
</data>
|
|
</openerp>
|