mirror of
https://github.com/bringout/oca-ocb-hr.git
synced 2026-04-27 09:12:01 +02:00
19.0 vanilla
This commit is contained in:
parent
a1137a1456
commit
e1d89e11e3
2789 changed files with 1093187 additions and 605897 deletions
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="view_attendance_overtime_line_list" model="ir.ui.view">
|
||||
<field name="name">hr.attendance</field>
|
||||
<field name="model">hr.attendance</field>
|
||||
<field name="inherit_id" ref="hr_attendance.hr_attendance_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="manual_duration" position="after">
|
||||
<field name="compensable_as_leave" optional="show"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_attendance_overtime_rule_view_form" model="ir.ui.view">
|
||||
<field name="name">hr.attendance.overtime.rule.form.inherit.hr_work_entry_attendance</field>
|
||||
<field name="model">hr.attendance.overtime.rule</field>
|
||||
<field name="inherit_id" ref="hr_attendance.hr_attendance_overtime_rule_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<group name="action_section" position="inside">
|
||||
<field name="compensable_as_leave"/>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
|
@ -8,30 +8,26 @@
|
|||
<field name="priority" eval="120"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//header" position="inside">
|
||||
<field name="total_overtime" invisible="1"/>
|
||||
<button
|
||||
name="%(hr_leave_allocation_overtime_manager_action)d"
|
||||
string="Deduct Extra Hours"
|
||||
type="action"
|
||||
groups="hr_holidays.group_hr_holidays_user"
|
||||
context="{'default_employee_id': id, 'deduct_extra_hours': True}"
|
||||
attrs="{'invisible': [('total_overtime', '<=', 1)]}"/>
|
||||
invisible="total_overtime <= 1 or not active"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- TODO: remove in master -->
|
||||
<record id="hr_employee_view_form" model="ir.ui.view">
|
||||
<field name="name">hr.employee.holidays.attendance.inherit</field>
|
||||
<field name="model">hr.employee</field>
|
||||
<field name="inherit_id" ref="hr_attendance.view_employee_form_inherit_hr_attendance"/>
|
||||
<field name="priority" eval="125" />
|
||||
<record id="hr_attendance_employee_simple_tree_view" model="ir.ui.view">
|
||||
<field name="name">hr.attendance.employee.simple.tree.view.inherit.hr_holidays_attendance</field>
|
||||
<field name="model">hr.attendance</field>
|
||||
<field name="inherit_id" ref="hr_attendance.hr_attendance_employee_simple_tree_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@id='hr_presence_status']" position="attributes">
|
||||
<attribute name="attrs">
|
||||
{'invisible': False}
|
||||
</attribute>
|
||||
</xpath>
|
||||
<list position="attributes">
|
||||
<attribute name="js_class">extra_hours_list_view</attribute>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version='1.0' encoding='UTF-8' ?>
|
||||
<odoo>
|
||||
<record id="hr_leave_accrual_level_view_form" model="ir.ui.view">
|
||||
<field name="name">hr.leave.accrual.level.form</field>
|
||||
<field name="model">hr.leave.accrual.level</field>
|
||||
<field name="inherit_id" ref="hr_holidays.hr_accrual_level_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='frequency']" position="replace">
|
||||
<field nolabel="1" name="frequency" invisible="accrued_gain_time == 'end'"
|
||||
widget="filterable_selection" options="{'blacklisted_values': ['worked_hours']}"/>
|
||||
<field nolabel="1" name="frequency" invisible="accrued_gain_time == 'start'"
|
||||
widget="selection"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
|
@ -5,20 +5,15 @@
|
|||
<field name="inherit_id" ref="hr_holidays.hr_leave_allocation_view_form" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="(//div[@name='duration_display']/span)[last()]" position="after">
|
||||
<field name="hr_attendance_overtime" invisible="1" />
|
||||
<field name="overtime_deductible" invisible="1" />
|
||||
<field name="employee_overtime" invisible="1" />
|
||||
<div class="oe_inline"
|
||||
attrs="{'invisible': ['|', '|', '|',
|
||||
('hr_attendance_overtime', '=', False), ('employee_id', '=', False),
|
||||
('overtime_deductible', '=', False), ('employee_overtime', '<=', 0)]}">
|
||||
invisible="not employee_id or not overtime_deductible or employee_overtime <= 0">
|
||||
<field name="employee_overtime" nolabel="1" widget="float_time" class="text-success" /> Extra Hours Available
|
||||
</div>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_leave_allocation_overtime_view_form" model="ir.ui.view">
|
||||
<record id="hr_leave_allocation_overtime_manager_view_form" model="ir.ui.view">
|
||||
<field name="model">hr.leave.allocation</field>
|
||||
<field name="inherit_id" ref="hr_attendance_holidays_hr_leave_allocation_view_form_inherit" />
|
||||
<field name="mode">primary</field>
|
||||
|
|
@ -31,7 +26,7 @@
|
|||
<attribute name="invisible">1</attribute>
|
||||
</div>
|
||||
<xpath expr="//field[@name='holiday_status_id']" position="attributes">
|
||||
<attribute name="domain">[('overtime_deductible', '=', True), ('requires_allocation', '=', 'yes'), ('employee_requests', '=', 'yes')]</attribute>
|
||||
<attribute name="domain">[('overtime_deductible', '=', True), ('requires_allocation', '=', True)]</attribute>
|
||||
<attribute name="options">{'no_create': True, 'no_open': True}</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//sheet" position="after">
|
||||
|
|
@ -43,26 +38,6 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_leave_allocation_overtime_manager_view_form" model="ir.ui.view">
|
||||
<field name="model">hr.leave.allocation</field>
|
||||
<field name="inherit_id" ref="hr_leave_allocation_overtime_view_form" />
|
||||
<field name="mode">primary</field>
|
||||
<field name="priority">70</field>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='holiday_status_id']" position="attributes">
|
||||
<attribute name="domain">[('overtime_deductible', '=', True), ('requires_allocation', '=', 'yes')]</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_leave_allocation_overtime_action" model="ir.actions.act_window">
|
||||
<field name="name">New Allocation Request</field>
|
||||
<field name="res_model">hr.leave.allocation</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_ids" eval="[(5, 0, 0), (0, 0, {'view_mode': 'form', 'view_id': ref('hr_leave_allocation_overtime_view_form')})]"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_leave_allocation_overtime_manager_action" model="ir.actions.act_window">
|
||||
<field name="name">New Allocation Request</field>
|
||||
<field name="res_model">hr.leave.allocation</field>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,135 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="hr_leave_attendance_report_view_list" model="ir.ui.view">
|
||||
<field name="name">hr.leave.attendance.report.list</field>
|
||||
<field name="model">hr.leave.attendance.report</field>
|
||||
<field name="arch" type="xml">
|
||||
<list sample="1" default_order="date desc">
|
||||
<field name="employee_id"/>
|
||||
<field name="date"/>
|
||||
<field name="schedule_id" optional="hide"/>
|
||||
<field name="expected_hours" widget="float_time"/>
|
||||
<field name="worked_hours" widget="float_time"/>
|
||||
<field name="leave_hours" widget="float_time"/>
|
||||
<field name="leave_type_names" optional="hide" groups="hr_holidays.group_hr_holidays_user"/>
|
||||
<field name="difference_hours" widget="float_time" decoration-danger="difference_hours < 0"
|
||||
decoration-success="difference_hours >= 0" decoration-bf="True"/>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_leave_attendance_report_view_pivot" model="ir.ui.view">
|
||||
<field name="name">hr.leave.attendance.report.pivot</field>
|
||||
<field name="model">hr.leave.attendance.report</field>
|
||||
<field name="arch" type="xml">
|
||||
<pivot sample="1">
|
||||
<field name="employee_id" type="row"/>
|
||||
<field name="date" interval="month" type="col"/>
|
||||
<field name="expected_hours" type="measure" widget="float_time"/>
|
||||
<field name="worked_hours" type="measure" widget="float_time"/>
|
||||
<field name="leave_hours" type="measure" widget="float_time"/>
|
||||
<field name="difference_hours" type="measure" widget="float_time"/>
|
||||
</pivot>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_leave_attendance_report_view_form" model="ir.ui.view">
|
||||
<field name="name">hr.leave.attendance.report.form</field>
|
||||
<field name="model">hr.leave.attendance.report</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<sheet>
|
||||
<h1><field name="employee_id" widget="many2one_avatar_employee"/></h1>
|
||||
<group name="report_details">
|
||||
<group>
|
||||
<field name="date"/>
|
||||
<field name="worked_hours" widget="float_time"/>
|
||||
<field name="leave_hours" widget="float_time"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="schedule_id"/>
|
||||
<field name="expected_hours" widget="float_time"/>
|
||||
<field name="difference_hours" widget="float_time" decoration-danger="difference_hours < 0"
|
||||
decoration-success="difference_hours >= 0" decoration-bf="True"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
<page name="attendances" string="Attendance Records">
|
||||
<field name="attendance_ids">
|
||||
<list>
|
||||
<field name="check_in"/>
|
||||
<field name="check_out"/>
|
||||
<field name="worked_hours" widget="float_time"/>
|
||||
<field name="overtime_hours" string="Worked Extra Hours" widget="float_time"
|
||||
optional="hide"/>
|
||||
<field name="validated_overtime_hours" widget="float_time" optional="hide"/>
|
||||
</list>
|
||||
</field>
|
||||
</page>
|
||||
<page name="leaves" string="Approved Time Offs">
|
||||
<field name="leave_ids">
|
||||
<list>
|
||||
<field name="holiday_status_id"/>
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
<field name="duration_display" string="Duration"/>
|
||||
</list>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_leave_attendance_report_view_search" model="ir.ui.view">
|
||||
<field name="name">hr.leave.attendance.report.search</field>
|
||||
<field name="model">hr.leave.attendance.report</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="employee_id" string="Employee"/>
|
||||
<field name="date" string="Date"/>
|
||||
<field name="schedule_id" string="Working Schedule"/>
|
||||
<filter name="less_than_0" string="Missing Hours" domain="[('difference_hours', '<', 0)]"/>
|
||||
<separator/>
|
||||
<filter name="date" string="Date" date="date"/>
|
||||
<filter string="Last 2 Months" name="last_two_months" invisible="1"
|
||||
domain="[('date', '>', '-2m =1d')]"/>
|
||||
<separator/>
|
||||
<filter string="Archived Employees" name="archived_employees"
|
||||
domain="[('active', '=', False)]"/>
|
||||
<group name="groupby">
|
||||
<filter string="Date" name="group_by_date" context="{'group_by': 'date'}"/>
|
||||
<filter string="Employees" name="group_by_employees" context="{'group_by': 'employee_id'}"/>
|
||||
<separator/>
|
||||
<filter string="Department" name="group_by_departments" context="{'group_by': 'department_id'}"/>
|
||||
<filter string="Job Position" name="group_by_jobs" context="{'group_by': 'job_id'}"/>
|
||||
<filter string="Working Schedule" name="group_by_schedule" context="{'group_by': 'schedule_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_leave_attendance_report_action" model="ir.actions.act_window">
|
||||
<field name="name">Time Off Ledger</field>
|
||||
<field name="res_model">hr.leave.attendance.report</field>
|
||||
<field name="path">absence-report</field>
|
||||
<field name="view_mode">list,pivot,form</field>
|
||||
<field name="domain">[('employee_id.company_id', 'in', allowed_company_ids)]</field>
|
||||
<field name="context">{
|
||||
'search_default_group_by_date': 1,
|
||||
'search_default_group_by_employees': 1,
|
||||
'search_default_less_than_0': 1,
|
||||
'search_default_last_two_months': 1,
|
||||
}</field>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
id="hr_leave_attendance_report"
|
||||
name="Time Off Ledger"
|
||||
action="hr_leave_attendance_report_action"
|
||||
parent="hr_attendance.menu_hr_attendance_reporting"
|
||||
sequence="15"/>
|
||||
|
||||
</odoo>
|
||||
|
|
@ -4,11 +4,14 @@
|
|||
<field name="name">hr.leave.type.view.form.inherit</field>
|
||||
<field name="model">hr.leave.type</field>
|
||||
<field name="inherit_id" ref="hr_holidays.edit_holiday_status_form"/>
|
||||
<field name="priority">30</field>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='request_unit']" position="after">
|
||||
<field name="hr_attendance_overtime" invisible="1" />
|
||||
<field name="overtime_deductible" attrs="{'invisible': [('hr_attendance_overtime', '=', False)]}"/>
|
||||
</xpath>
|
||||
<label for="support_document" position="after">
|
||||
<label for="overtime_deductible" class="fw-bold me-4"/>
|
||||
</label>
|
||||
<field name="support_document" nolabel="1" position="after">
|
||||
<field name="overtime_deductible" nolabel="1"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
|
|
|||
|
|
@ -4,13 +4,10 @@
|
|||
<field name="model">hr.leave</field>
|
||||
<field name="inherit_id" ref="hr_holidays.hr_leave_view_form_manager" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="(//div[@name='duration_display']/div)[last()]" position="after">
|
||||
<field name="overtime_deductible" invisible="1" />
|
||||
<field name="employee_overtime" invisible="1" />
|
||||
<div attrs="{'invisible': ['|', '|', ('employee_id', '=', False), ('overtime_deductible', '=', False), ('employee_overtime', '<=', 0)]}">
|
||||
<field name="employee_overtime" nolabel="1" widget="float_time" class="text-success" style="width: 6rem;" /> Extra Hours Available
|
||||
</div>
|
||||
</xpath>
|
||||
<field name='holiday_status_id' position="after">
|
||||
<field name="employee_overtime" string="Extra Hours Available" widget="float_time" class="text-success" style="width: 6rem;"
|
||||
invisible="not employee_id or not overtime_deductible or employee_overtime <= 0"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
|
|
|||
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="res_users_view_form" model="ir.ui.view">
|
||||
<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">
|
||||
<field name="employee_id" invisible="1" />
|
||||
<field name="request_overtime" invisible="1" />
|
||||
<button
|
||||
name="%(hr_leave_allocation_overtime_action)d"
|
||||
string="Deduct Extra Hours"
|
||||
type="action"
|
||||
context="{'default_employee_id': employee_id, 'deduct_extra_hours': True, 'deduct_extra_hours_employee_request': True}"
|
||||
attrs="{'invisible': [('request_overtime', '=', False)]}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Loading…
Add table
Add a link
Reference in a new issue