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

@ -1,94 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record id="hr_employee_search_view" model="ir.ui.view">
<field name="name">hr.employee.search.view</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_filter"/>
<field name="arch" type="xml">
<xpath expr="//separator[@name='managers_groupby_separator']" position="before">
<filter name="group_attendance_manager" string="Attendance Approver" context="{'group_by': 'attendance_manager_id'}" groups="hr_attendance.group_hr_attendance_user"/>
</xpath>
</field>
</record>
<record id="view_employee_form_inherit_hr_attendance" model="ir.ui.view">
<field name="name">hr.employee</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="priority">110</field>
<field name="arch" type="xml">
<xpath expr="//div[@name='button_box']" position="inside">
<button name="action_open_versions" position="before">
<field name="attendance_state" invisible="1"/>
<button name="%(hr_attendance_action)d"
<field name="hours_last_month" groups="hr_attendance.group_hr_attendance_officer" invisible="1"/>
<button name="action_open_last_month_attendances"
class="oe_stat_button"
icon="fa-clock-o"
type="action"
context="{'search_default_employee_id': id, 'search_default_check_in_filter': '1'}"
groups="hr_attendance.group_hr_attendance_user"
help="Worked hours last month">
type="object"
groups="hr_attendance.group_hr_attendance_officer"
help="Worked hours this month">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
<field name="hours_last_month_display" widget="float_time"/> Hours
<field name="hours_last_month" widget="float_time"/>
<span class="o_stat_value text-success" invisible="hours_last_month_overtime &lt;= 0 or not display_extra_hours">
(+<field name="hours_last_month_overtime" widget="float_time"/>)
</span>
<span class="o_stat_value text-danger" invisible="hours_last_month_overtime &gt;= 0 or not display_extra_hours">
(<field name="hours_last_month_overtime" widget="float_time"/>)
</span>
</span>
<span class="o_stat_text">
Last Month
Monthly Hours
</span>
</div>
</button>
<button name="%(hr_attendance_overtime_action)d"
class="oe_stat_button"
icon="fa-history"
type="action"
attrs="{'invisible': [('total_overtime', '=', 0.0)]}"
context="{'search_default_employee_id': active_id}"
groups="hr_attendance.group_hr_attendance_user">
<div class="o_stat_info">
<span class="o_stat_value text-success" attrs="{'invisible': [('total_overtime', '&lt;', 0)]}">
<field name="total_overtime" widget="float_time"/>
</span>
<span class="o_stat_value text-danger" attrs="{'invisible': [('total_overtime', '&gt;=', 0)]}">
<field name="total_overtime" widget="float_time"/>
</span>
<span class="o_stat_text">Extra Hours</span>
</div>
</button>
</button>
<xpath expr="//group[@name='managers']" position="inside">
<field name="attendance_manager_id" string="Attendance" widget="many2one_avatar_user" groups="hr_attendance.group_hr_attendance_user"/>
</xpath>
</field>
</record>
<record id="hr_user_view_form" model="ir.ui.view">
<field name="name">hr.user.preferences.view.form.attendance.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="//div[@name='button_box']" position="inside">
<field name="employee_ids" invisible="1"/>
<button name="%(hr_attendance_action_employee)d"
class="oe_stat_button"
icon="fa-calendar"
type="action"
context="{'search_default_employee_id': employee_ids, 'search_default_check_in_filter': '1'}"
groups="base.group_user"
help="Worked hours last month">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
<field name="hours_last_month_display" widget="float_time"/> Hours
</span>
<span class="o_stat_text">
Last Month
</span>
</div>
</button>
<xpath expr="//field[@name='barcode']" position="attributes">
<attribute name="string">RFID/Badge Number</attribute>
</xpath>
<xpath expr="//div[@name='button_box']" position="inside">
<button name="%(hr_attendance_overtime_action)d"
class="oe_stat_button"
icon="fa-history"
type="action"
attrs="{'invisible': [('total_overtime', '=', 0.0)]}"
context="{'search_default_employee_id': employee_ids}"
groups="base.group_user"
help="Amount of extra hours">
<div class="o_stat_info">
<span class="o_stat_value text-success" attrs="{'invisible': [('total_overtime', '&lt;', 0)]}">
<field name="total_overtime" widget="float_time"/>
</span>
<span class="o_stat_value text-danger" attrs="{'invisible': [('total_overtime', '&gt;=', 0)]}">
<field name="total_overtime" widget="float_time"/>
</span>
<span class="o_stat_text">Extra Hours</span>
</div>
</button>
<xpath expr="//button[@name='generate_random_barcode']" position="after">
<button name="open_barcode_scanner" string="Read a badge" type="object" class="btn btn-link" invisible="barcode"/>
</xpath>
<!-- identification_group -->
<group name="identification_group" position="inside">
<field
name="ruleset_id" string="Overtime Ruleset"
placeholder="Select a ruleset to manage overtime."
/>
</group>
</field>
</record>
@ -98,37 +68,28 @@
<field name="model">hr.employee</field>
<field name="priority">99</field>
<field name="arch" type="xml">
<kanban class="o_hr_employee_attendance_kanban" create="false" action="action_employee_kiosk_confirm" type="object">
<kanban create="false">
<field name="attendance_state"/>
<field name="hours_today"/>
<field name="total_overtime"/>
<field name="id"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click">
<div class="o_kanban_image">
<img t-att-src="kanban_image('hr.employee.public', 'avatar_128', record.id.raw_value)" alt="Employee"/>
</div>
<div class="oe_kanban_details">
<div id="textbox">
<t t-name="card" class="flex-row">
<aside>
<field name="avatar_128" widget="image" alt="Employee" class="mb-0"/>
</aside>
<main class="w-100 ms-2">
<div>
<div class="float-end" t-if="record.attendance_state.raw_value == 'checked_in'">
<span id="oe_hr_attendance_status" class="fa fa-circle text-success me-1" role="img" aria-label="Available" title="Available"></span>
<span class="fa fa-circle text-success me-1" role="img" aria-label="Available" title="Available"></span>
</div>
<div class="float-end" t-if="record.attendance_state.raw_value == 'checked_out'">
<span id="oe_hr_attendance_status" class="fa fa-circle text-warning me-1"
<span class="fa fa-circle text-warning me-1"
role="img" aria-label="Not available" title="Not available">
</span>
</div>
<strong>
<field name="name"/>
</strong>
<field class="fw-bolder" name="name"/>
</div>
<ul>
<li t-if="record.job_id.raw_value"><field name="job_id"/></li>
<li t-if="record.work_location_id.raw_value"><field name="work_location_id"/></li>
</ul>
</div>
</div>
<field t-if="record.job_id.raw_value" name="job_id"/>
<field t-if="record.work_location_id.raw_value" name="work_location_id"/>
</main>
</t>
</templates>
</kanban>
@ -151,4 +112,67 @@
</field>
</record>
<record id="view_employee_tree_inherit_leave" model="ir.ui.view">
<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="attendance_manager_id" optional="hide" widget="many2one_avatar_user" groups="hr_attendance.group_hr_attendance_user"/>
</xpath>
</field>
</record>
<record id="hr_attendance_employee_simple_tree_view" model="ir.ui.view">
<field name="name">hr.attendance.list</field>
<field name="model">hr.attendance</field>
<field name="arch" type="xml">
<list sample="1">
<field name="check_in"/>
<field name="check_out"/>
<field name="worked_hours" string="Work Hours" widget="float_time"/>
<field name="validated_overtime_hours" string="Extra Hours" widget="float_time" column_invisible="not context.get('display_extra_hours')"/>
<field name="overtime_status" string="Status" widget="badge"
decoration-warning="overtime_status == 'to_approve'"
decoration-success="overtime_status == 'approved'"
decoration-danger="overtime_status == 'refused'"
column_invisible="not context.get('display_extra_hours')"
optional="hide"
/>
</list>
</field>
</record>
<record id="hr_attendance_employee_simple_form_view" model="ir.ui.view">
<field name="name">hr.attendance.form</field>
<field name="model">hr.attendance</field>
<field name="mode">primary</field>
<field name="inherit_id" ref="hr_attendance.hr_attendance_view_form"/>
<field name="arch" type="xml">
<field name="overtime_status" position="attributes">
<attribute name="readonly">1</attribute>
</field>
<xpath expr="//field[@id='employee_no_manager']" position="replace"/>
<xpath expr="//field[@id='employee_manager']" position="replace"/>
<xpath expr="//field[@id='employee_no_officer']" position="attributes">
<attribute name="groups"/>
</xpath>
<field name="check_in" position="attributes">
<attribute name="readonly">1</attribute>
</field>
<field name="check_out" position="attributes">
<attribute name="readonly">1</attribute>
</field>
<field name="validated_overtime_hours" position="attributes">
<attribute name="readonly">1</attribute>
</field>
<button name="action_approve_overtime" position="attributes">
<attribute name="invisible">1</attribute>
</button>
<button name="action_refuse_overtime" position="attributes">
<attribute name="invisible">1</attribute>
</button>
</field>
</record>
</odoo>