[ADD]hr_employee_stats_sheet

This commit is contained in:
2025-09-17 11:08:21 +02:00
parent 0dc8075a81
commit fd5e0f2f44
17 changed files with 1462 additions and 0 deletions

View File

@@ -0,0 +1,78 @@
<odoo>
<data>
<!-- Ajout d'une vue tree pour les stats dans la timesheet_sheet -->
<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'),
('timesheet_sheet_recovery_hours', '=', 0)]}"
/>
</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>
<!-- Ajout d'une vue heure d'écart et récup sur la vue tree des hr_timesheet.sheet -->
<record id="view_hr_timesheet_sheet_tree_stats_inherit" model="ir.ui.view">
<field name="name">hr.timesheet.sheet.tree.stats.inherit</field>
<field name="model">hr_timesheet.sheet</field>
<field name="inherit_id" ref="hr_timesheet_sheet.hr_timesheet_sheet_tree" />
<field name="arch" type="xml">
<field name="department_id" position="after">
<field name="timesheet_sheet_gap_hours" string="Heures d'écart" optional="show" widget="float_time" />
<field name="timesheet_sheet_recovery_hours" string="Heures de récupération" optional="hide" widget="float_time" />
</field>
</field>
</record>
<!-- Ajout d'une vue pivot pour hr_timesheet.sheet -->
<!-- <record id="hr_timesheet_sheet_pivot" model="ir.ui.view">
<field name="name">hr.timesheet.sheet.pivot</field>
<field name="model">hr_timesheet.sheet</field>
<field name="arch" type="xml">
<pivot string="Timesheet Sheets Analysis">
<field name="employee_id" type="row"/>
<field name="department_id"/>
<field name="reviewer_id"/>
<field name="state"/>
<field name="date_start" type="row"/>
<field name="date_end"/>
<field name="total_time" type="measure" />
</pivot>
</field>
</record> -->
<!-- Ajout de la vue pivot à l'action "All Timesheet Sheets" -->
<!-- <record id="act_hr_timesheet_sheet_all_timesheets_pivot" model="ir.actions.act_window.view">
<field name="view_mode">pivot</field>
<field name="sequence" eval="10"/>
<field name="view_id" ref="hr_timesheet_sheet_pivot"/>
<field name="act_window_id" ref="hr_timesheet_sheet.act_hr_timesheet_sheet_all_timesheets"/>
</record> -->
</data>
</odoo>