odex30_standard/hr_holidays_community/views/hr_views.xml

115 lines
5.5 KiB
XML

<?xml version='1.0' encoding='UTF-8'?>
<odoo>
<!--Hr Department Inherit Kanban view-->
<record id="hr_department_view_kanban" model="ir.ui.view">
<field name="name">hr.department.kanban.inherit</field>
<field name="model">hr.department</field>
<field name="inherit_id" ref="hr.hr_department_view_kanban"/>
<field name="arch" type="xml">
<data>
<xpath expr="//templates" position="before">
<field name="leave_to_approve_count"/>
<field name="allocation_to_approve_count"/>
<field name="total_employee"/>
<field name="absence_of_today"/>
</xpath>
<xpath expr="//div[@name='kanban_primary_right']" position="inside">
<div t-if="record.leave_to_approve_count.raw_value > 0" class="mb-1">
<a name="%(hr_holidays_action_request_from_department)d" type="action" class="btn btn-sm btn-secondary w-100" role="button">
<field name="leave_to_approve_count"/> Leave Requests
</a>
</div>
<div t-if="record.allocation_to_approve_count.raw_value > 0" class="mb-1">
<a name="%(hr_holidays_action_allocation_from_department)d" type="action" class="btn btn-sm btn-secondary w-100" role="button">
<field name="allocation_to_approve_count"/> Allocations
</a>
</div>
</xpath>
<xpath expr="//div[@name='kanban_card_lower_content']" position="inside">
<div class="d-flex align-items-center">
<span class="me-2">Absence:</span>
<field name="absence_of_today" widget="progressbar" options="{'current_value': 'absence_of_today', 'max_value': 'total_employee', 'editable': False}"/>
</div>
</xpath>
<xpath expr="//div[hasclass('o_kanban_manage_reports')]" position="inside">
<div role="menuitem">
<a name="%(action_hr_holidays_leaves_analysis_filtered)d" type="action">
Leaves
</a>
</div>
</xpath>
</data>
</field>
</record>
<!--Hr Employee inherit search view-->
<record id="hr_employee_view_search" model="ir.ui.view">
<field name="name">hr.employee.search.view.inherit</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_filter"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='inactive']" position="after">
<filter name="is_absent_today" string="Absent Today" domain="[('is_absent_today', '=', True)]"/>
</xpath>
</field>
</record>
<record id="hr_kanban_view_employees_kanban" model="ir.ui.view">
<field name="name">hr.employee.kanban.leaves.status</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.hr_kanban_view_employees"/>
<field name="arch" type="xml">
<xpath expr="//templates" position="before">
<field name="current_leave_id"/>
<field name="current_leave_state"/>
<field name="leave_date_from"/>
<field name="leave_date_to"/>
</xpath>
<xpath expr="//footer" position="inside">
<div t-if="record.current_leave_id.raw_value" class="mt-1">
<span class="badge"
t-att-class="record.current_leave_state.raw_value=='validate'?'text-bg-success':'text-bg-warning'"
t-att-title="(record.leave_date_from.raw_value ? luxon.DateTime.fromISO(record.leave_date_from.raw_value).toFormat('dd LLL') : '') + ' - ' + (record.leave_date_to.raw_value ? luxon.DateTime.fromISO(record.leave_date_to.raw_value).toFormat('dd LLL') : '')">
<field name="current_leave_id"/>
</span>
</div>
</xpath>
</field>
</record>
<!-- Hr employee inherit Legal Leaves -->
<record id="view_employee_form_leave_inherit" model="ir.ui.view">
<field name="name">hr.employee.leave.form.inherit</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='active_group']" position="after">
<group string="Leaves" groups="base.group_no_one">
<label for="remaining_leaves"/>
<div>
<field name="remaining_leaves" class="oe_inline"/> days
</div>
</group>
</xpath>
<xpath expr="//div[@name='button_box']" position="inside">
<field name="show_leaves" invisible="1"/>
<button name="%(act_hr_employee_holiday_request)d"
type="action"
class="oe_stat_button"
icon="fa-calendar"
invisible="show_leaves == False"
groups="base.group_user"
help="Remaining leaves">
<field string="Leaves Left" name="leaves_count" widget="statinfo"/>
</button>
</xpath>
</field>
</record>
</odoo>