19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:31:00 +01:00
parent a1137a1456
commit e1d89e11e3
2789 changed files with 1093187 additions and 605897 deletions

View file

@ -4,10 +4,11 @@
<record id="hr_employee_action_from_department" model="ir.actions.act_window">
<field name="name">Absent Employees</field>
<field name="res_model">hr.employee</field>
<field name="view_mode">tree,kanban,form</field>
<field name="view_mode">list,kanban,form</field>
<field name="context">{
'search_default_is_absent': 1,
'search_default_on_timeoff': 1,
'searchpanel_default_department_id': active_id,
'search_default_department_id': active_id,
'default_department_id': active_id}
</field>
<field name="search_view_id" ref="hr.view_employee_filter"/>
@ -22,50 +23,42 @@
<data>
<xpath expr="//templates" position="before">
<t groups="hr_holidays.group_hr_holidays_user">
<field name="leave_to_approve_count"/>
<field name="allocation_to_approve_count"/>
<field name="total_employee"/>
<field name="absence_of_today"/>
</t>
</xpath>
<xpath expr="//div[hasclass('o_kanban_primary_right')]" position="inside">
<t groups="hr_holidays.group_hr_holidays_user">
<div t-if="record.leave_to_approve_count.raw_value > 0" class="row ml16">
<div class="col">
<a name="action_open_leave_department" type="object">
<field name="leave_to_approve_count"/> Time Off Requests
</a>
</div>
</div>
<div t-if="record.allocation_to_approve_count.raw_value > 0" class="row ml16">
<div class="col">
<a name="action_open_allocation_department" type="object">
<field name="allocation_to_approve_count"/> Allocation Requests
</a>
</div>
</div>
</t>
<xpath expr="//div[@name='kanban_primary_right']" position="inside">
<div t-if="record.leave_to_approve_count.raw_value > 0" class="row ml32 g-0" groups="hr_holidays.group_hr_holidays_user">
<a name="action_open_leave_department" class="col" type="object">
<field name="leave_to_approve_count" groups="hr_holidays.group_hr_holidays_user"/> Time Off Requests
</a>
</div>
<div t-if="record.allocation_to_approve_count.raw_value > 0" class="row ml32 g-0" groups="hr_holidays.group_hr_holidays_user">
<a name="action_open_allocation_department" class="col" type="object">
<field name="allocation_to_approve_count" groups="hr_holidays.group_hr_holidays_user"/> Allocation Requests
</a>
</div>
</xpath>
<xpath expr="//div[hasclass('o_kanban_card_lower_content')]" position="inside">
<t groups="hr_holidays.group_hr_holidays_user">
<div class="row o_kanban_primary_bottom bottom_block bg-view"
t-if="record.absence_of_today.raw_value > 0">
<div class="col-3">
<a name="%(hr_employee_action_from_department)d" type="action" title="Absent Employee(s), Whose time off requests are either confirmed or validated on today">Absence</a>
</div>
<div class="col-9">
<field name="absence_of_today" widget="progressbar" options="{'current_value': 'absence_of_today', 'max_value': 'total_employee', 'editable': false}"/>
</div>
<xpath expr="//div[@name='kanban_card_lower_content']" position="inside">
<div class="row g-0 border-top border-1 mt-2 pt-2 mx-n2 bg-view"
t-if="record.absence_of_today.raw_value > 0" groups="hr_holidays.group_hr_holidays_user">
<div class="col-3 ms-3">
<a name="%(hr_employee_action_from_department)d" type="action" title="Absent Employee(s), Whose time off requests are either confirmed or validated on today">Absence</a>
</div>
</t>
<div class="col-7">
<field name="absence_of_today" widget="progressbar" options="{'current_value': 'absence_of_today', 'max_value': 'total_employee', 'editable': false}"/>
</div>
</div>
</xpath>
<xpath expr="//div[hasclass('o_kanban_manage_reports')]" position="inside">
<a role="menuitem" class="dropdown-item" name="%(hr_leave_action_action_department)d" type="action" groups="hr_holidays.group_hr_holidays_user">
Time Off
</a>
<div role="menuitem">
<a class="dropdown-item" name="%(hr_leave_report_action)d" type="action">
Time Off
</a>
</div>
</xpath>
</data>
</field>
@ -77,8 +70,13 @@
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_filter"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='job_id']" position="after">
<filter name="is_absent" string="Absent Today" domain="[('is_absent', '=', True)]"/>
<xpath expr="//filter[@name='my_team']" position="before">
<filter name="at_work" string="At work" domain="[('is_absent', '=', False)]"/>
<filter name="on_timeoff" string="On Time Off" domain="[('is_absent', '=', True)]"/>
<separator/>
</xpath>
<xpath expr="//separator[@name='secondary_groupby_separator']" position="after">
<filter name="group_leave_manager" string="Time Off Approver" context="{'group_by': 'leave_manager_id'}"/>
</xpath>
</field>
</record>
@ -92,22 +90,6 @@
<xpath expr="//templates" position="before">
<field name="is_absent"/>
</xpath>
<xpath expr="//strong[hasclass('o_kanban_record_title')]" position="inside"
t-if="record.show_hr_icon_display.raw_value">
<!-- Employee is absent, in holiday but he is connected -->
<div class="float-end"
t-if="record.hr_icon_display.raw_value == 'presence_holiday_present'">
<span class="fa fa-plane text-success" role="img" aria-label="Present but on leave"
title="Present but on leave" name="presence_absent_active">
</span>
</div>
<!-- Employee is on holiday, not present and not connected -->
<div class="float-end"
t-if="record.hr_icon_display.raw_value == 'presence_holiday_absent'"
name="presence_absent">
<span class="fa fa-plane text-warning" role="img" aria-label="To define" title="On Leave"/>
</div>
</xpath>
</field>
</record>
@ -123,30 +105,8 @@
<field name="leave_date_to"/>
<field name="is_absent"/>
</xpath>
<xpath expr="//div[@name='presence_absent_active']" position="after"
t-if="record.show_hr_icon_display.raw_value">
<!-- Employee is absent, in holiday but he is connected -->
<!-- green plane -->
<div class="float-end"
t-if="record.hr_icon_display.raw_value == 'presence_holiday_present'">
<span class="fa fa-plane text-success" role="img" aria-label="Present but on leave"
title="Present but on leave" name="presence_absent_active">
</span>
</div>
<!-- Employee is on holiday, not present and not connected -->
<!-- orange plane -->
<div class="float-end"
t-if="record.hr_icon_display.raw_value == 'presence_holiday_absent'"
name="presence_absent">
<span class="fa fa-plane text-warning" role="img" aria-label="To define" title="On Leave"/>
</div>
</xpath>
<xpath expr="//li[@id='last_login']" position="inside">
<span t-if="record.current_leave_id.raw_value" style="font-size: 100%"
t-att-class="record.current_leave_state.raw_value=='validate'?'oe_kanban_button oe_kanban_color_3':'oe_kanban_button oe_kanban_color_2'"
t-att-title="luxon.DateTime.fromISO(record.leave_date_from.raw_value).toFormat('ccc d MMM') + ' - ' + luxon.DateTime.fromISO(record.leave_date_to.raw_value).toFormat('ccc d MMM')">
<field name="current_leave_id"/>
</span>
<xpath expr="//field[@name='hr_icon_display']" position="attributes">
<attribute name="widget">hr_presence_status_private</attribute>
</xpath>
</field>
</record>
@ -156,80 +116,45 @@
<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 = "priority" eval="20" />
<field name="priority" eval="20"/>
<field name="arch" type="xml">
<xpath expr="//div[@id='hr_presence_status']" position="attributes">
<attribute name="attrs">
{'invisible': ['|', '|', ('last_activity', '=', False), ('user_id', '=', False), ('id', '=', False)]}
</attribute>
</xpath>
<xpath expr="//div[@id='hr_presence_status']" position="inside">
<!-- Employee is absent, in holiday but he is connected -->
<div role="img" class="fa fa-fw fa-plane text-success o_button_icon hr_presence" attrs="{'invisible': [('hr_icon_display', '!=', 'presence_holiday_present')]}" aria-label="Present but on leave" title="Present but on leave" name="presence_absent_active"/>
<!-- Employee is on holiday, not present and not connected -->
<div role="img" class="fa fa-fw fa-plane text-warning o_button_icon hr_presence" attrs="{'invisible': [('hr_icon_display', '!=', 'presence_holiday_absent')]}" aria-label="On Leave" title="On Leave" name="presence_absent"/>
</xpath>
<xpath expr="//group[@name='managers']" position="inside">
<field name="leave_manager_id"/>
<field name="leave_manager_id" string="Time Off" widget="many2one_avatar_user"/>
</xpath>
<xpath expr="//group[@name='managers']" position="attributes">
<attribute name="invisible">0</attribute>
<xpath expr="//field[@name='hr_icon_display']" position="attributes">
<attribute name="widget">hr_presence_status_private</attribute>
</xpath>
<xpath expr="//div[@name='button_box']" position="inside">
<button name="action_open_versions" position="before">
<field name="show_leaves" invisible="1"/>
<field name="is_absent" invisible="1"/>
<field name="hr_icon_display" invisible="1"/>
<button name="action_time_off_dashboard"
type="object"
class="oe_stat_button"
context="{'search_default_employee_ids': active_id}"
attrs="{'invisible': [('is_absent', '=', False)]}">
<div attrs="{'invisible': [('hr_icon_display', '!=', 'presence_holiday_present')]}"
role="img" class="fa fa-fw fa-plane o_button_icon text-success" aria-label="Off Till" title="Off Till"/>
<div attrs="{'invisible': [('hr_icon_display', '!=', 'presence_holiday_absent')]}" role="img"
class="fa fa-fw fa-plane o_button_icon text-warning" aria-label="Off Till" title="Off Till"/>
<div class="o_field_widget o_stat_info">
<span class="o_stat_text">
Off Till
</span>
<span class="o_stat_value">
<field name="leave_date_to"/>
</span>
</div>
</button>
<button name="action_time_off_dashboard"
type="object"
class="oe_stat_button"
icon="fa-calendar"
attrs="{'invisible': [('show_leaves','=', False)]}"
context="{'search_default_employee_ids': active_id}"
invisible="not show_leaves or company_id not in allowed_company_ids"
groups="base.group_user"
help="Remaining leaves">
<div class="o_field_widget o_stat_info" attrs="{'invisible': [('allocation_display', '=', '0')]}">
<span class="o_stat_value">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value" invisible="allocation_display == '0'">
<field name="allocation_remaining_display"/>/<field name="allocation_display"/> Days
</span>
<span class="o_stat_text">
Time Off
</span>
</div>
<div class="o_field_widget o_stat_info" attrs="{'invisible': [('allocation_display', '!=', '0')]}">
<span class="o_stat_text">
Time Off
</span>
</div>
</button>
</xpath>
</button>
</field>
</record>
<record id="view_employee_tree_inherit_leave" model="ir.ui.view">
<field name="name">hr.employee.tree.leave</field>
<field name="name">hr.employee.list.leave</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='work_location_id']" position="after">
<field name="leave_manager_id" optional="hide" string="Time Off Approver"/>
<field name="leave_manager_id" optional="hide" widget="many2one_avatar_user"/>
</xpath>
</field>
</record>
@ -239,84 +164,30 @@
<field name="model">hr.employee.public</field>
<field name="inherit_id" ref="hr.hr_employee_public_view_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='coach_id']" position="after">
<field name="company_id" invisible="1"/>
<field name="leave_manager_id"/>
</xpath>
<xpath expr="//div[@name='button_box']" position="inside">
<field name="show_leaves" invisible="1"/>
<field name="is_absent" invisible="1"/>
<field name="hr_icon_display" invisible="1"/>
<button disabled="1"
<button name="action_open_time_off_calendar"
type="object"
class="oe_stat_button"
attrs="{'invisible': [('is_absent', '=', False)]}">
<div role="img" attrs="{'invisible': [('hr_icon_display', '!=', 'presence_holiday_present')]}"
class="fa fa-fw fa-plane o_button_icon text-success" aria-label="Off Till" title="Off Till"/>
<div attrs="{'invisible': [('hr_icon_display', '!=', 'presence_holiday_absent')]}" role="img"
class="fa fa-fw fa-plane o_button_icon text-warning" aria-label="Off Till" title="Off Till"/>
icon="fa-calendar"
invisible="show_leaves"
groups="base.group_user"
help="Remaining leaves">
<div class="o_field_widget o_stat_info">
<span class="o_stat_text">
Off Till
</span>
<span class="o_stat_value">
<field name="leave_date_to"/>
Time Off
</span>
</div>
</button>
</xpath>
</field>
</record>
<record id="res_users_view_form" model="ir.ui.view">
<field name="name">hr.user.preferences.view.form.leave.inherit</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="hr.res_users_view_form_profile"/>
<field name="arch" type="xml">
<xpath expr="//header" position="inside">
<button name="%(hr_leave_action_new_request)d"
string="Request Time off"
type="action"
class="btn btn-primary"/>
<button name="%(hr_leave_allocation_action_my)d"
string="Request Allocation"
type="action"
class="btn btn-primary"/>
</xpath>
<xpath expr="//group[@name='managers']" position="inside">
<field name="leave_manager_id" attrs="{'readonly': [('can_edit', '=', False)]}"/>
</xpath>
<xpath expr="//group[@name='managers']" position="attributes">
<attribute name="invisible">0</attribute>
</xpath>
<xpath expr="//div[@name='button_box']" position="inside">
<field name="show_leaves" invisible="1"/>
<field name="employee_ids" invisible="1"/>
<field name="is_absent" invisible="1"/>
<field name="hr_icon_display" invisible="1"/>
<button name="%(hr_leave_action_new_request)d" type="action"
class="oe_stat_button"
invisible="context.get('from_my_profile', False)"
attrs="{'invisible': [('is_absent', '=', False)]}">
<div attrs="{'invisible': [('hr_icon_display', '!=', 'presence_holiday_present')]}"
role="img" class="fa fa-fw fa-plane o_button_icon text-success" aria-label="Off Till"
title="Off Till"/>
<div attrs="{'invisible': [('hr_icon_display', '!=', 'presence_holiday_absent')]}"
role="img" class="fa fa-fw fa-plane o_button_icon text-warning" aria-label="Off Till"
title="Off Till"/>
<div class="o_field_widget o_stat_info">
<span class="o_stat_text">
Off Till
</span>
<span class="o_stat_value">
<field name="leave_date_to"/>
</span>
</div>
</button>
<button name="%(hr_leave_action_new_request)d"
type="action"
class="oe_stat_button"
icon="fa-calendar"
attrs="{'invisible': [('show_leaves','=', False)]}"
invisible="not is_user or not show_leaves"
groups="base.group_user"
help="Remaining leaves">
<div class="o_field_widget o_stat_info">