[ADD]hr_employee_stats_sheet

This commit is contained in:
2025-02-12 11:49:51 +01:00
committed by Stéphan Sainléger
parent 735a223c33
commit 098edfe838
18 changed files with 874 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
<odoo>
<record id="view_hr_employee_stats_tree" model="ir.ui.view">
<field name="name">hr.employee.stats.tree</field>
<field name="model">hr.employee.stats</field>
<field name="arch" type="xml">
<tree name="Employee time stats" editable="top" decoration-muted="dayofweek in [5,6] or is_public_holiday">
<field name="name"/>
<field name="date"/>
<field name="employee_id"/>
<field name="total_hours" widget="float_time" sum="Total"/>
<field name="total_leave_hours" widget="float_time" sum="Total"/>
<field name="total_recovery_hours" widget="float_time" sum="Total"/>
<field name="total_planned_hours" widget="float_time" sum="Total"/>
<field name="gap_hours" widget="float_time" sum="Total"/>
<field name="dayofweek" invisible="1"/>
<field name="is_public_holiday" invisible="1"/>
</tree>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,40 @@
<odoo>
<data>
<record id="view_hr_timesheet_sheet_form_inherit" model="ir.ui.view">
<field name="name">hr.timesheet.sheet.form.inherit</field>
<field name="model">hr_timesheet.sheet</field>
<field name="inherit_id" ref="hr_timesheet_sheet.hr_timesheet_sheet_form"/>
<field name="arch" type="xml">
<group name="dates" position="inside">
<field name="timesheet_sheet_gap_hours" string="Total gap hours in this timesheet sheet time range" widget="float_time"/>
<field name="timesheet_sheet_recovery_hours" string="Total recovery hours in this timesheet sheet time range" widget="float_time" style="font-weight: bold"/>
<button
colspan="2"
class="oe_highlight"
name="action_generate_recovery_allocation"
string='Create recovery allocation'
type='object'
attrs="{'invisible': ['|', ('can_review', '=', False), ('state', '!=', 'done')]}"
/>
</group>
<xpath expr="//notebook" position="inside">
<page string="Employee Stats">
<field name="employee_stats_ids" no_label="1" readonly="1"/>
</page>
<page string="Generated recovery allocations">
<field name="recovery_allocation_ids" no_label="1" readonly="1"/>
</page>
</xpath>
</field>
</record>
<record id="hr_timesheet_sheet_stats_overview_pivot_view" model="ir.ui.view">
<field name="name">hr.timesheet.sheet.stats.overview.pivot.view</field>
<field name="model">hr_timesheet.sheet</field>
<field name="arch" type="xml">
<pivot string="Employee time stats pivot" sample="1">
<field name="employee_id" type="row"/>
</pivot>
</field>
</record>
</data>
</odoo>

View File

@@ -0,0 +1,60 @@
<odoo>
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.hr.timesheet</field>
<field name="model">res.config.settings</field>
<field name="priority" eval="55" />
<field name="inherit_id" ref="hr_timesheet.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//div[@name='hr_timesheet_sheet']" position="inside">
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_right_pane">
<label for="recovery_type_id"/>
<span
class="fa fa-lg fa-building"
title="Values set here are company-specific."
aria-label="Values set here are company-specific."
groups="base.group_multi_company"
role="img"
/>
<div class="text-muted">
Choose the recovery type.
</div>
<div class="content-group">
<div class="mb16">
<field
name="recovery_type_id"
class="o_light_label"
widget="selection"
required="1"
/>
</div>
</div>
<div class="text-muted">
Choose the coef to apply to recovery hours.
</div >
<div class="content-group">
<div class="mb16">
<field
name="coef"
class="o_light_label"
widget="float"
/> %
</div>
</div>
<div class="text-muted">
Choose to auto-validate the recovery allocation or not
</div>
<div class="content-group">
<div class="mb16">
<field
name="auto_validate_recovery_allocation"
widget="boolean_toggle"
/>
</div>
</div>
</div>
</div>
</xpath>
</field>
</record>
</odoo>