[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,52 @@
==================================================
hr_employee_stats_sheet_project_timesheet_holidays
==================================================
Summary
=======
When holidays creates timesheets, exclude thoses timesheets to calculated total hours
Description
===========
Installation
============
``hr_employee_stats_sheet_project_timesheet_holidays`` self-installs
when ``hr_employee_stats_sheet``
and ``project_timesheet_holidays`` are installed
Known issues / Roadmap
======================
None yet.
Bug Tracker
===========
Bugs are tracked on `our issues website <https://github.com/elabore-coop/allow_negative_leave_and_allocation/issues>`_. In case of
trouble, please check there if your issue has already been
reported. If you spotted it first, help us smashing it by providing a
detailed and welcomed feedback.
Credits
=======
Contributors
------------
* `Alusage : Nicolas JEUDY`
* `Elabore <mailto:laetitia.dacosta@elabore.coop>`
Funders
-------
The development of this module has been financially supported by:
* Elabore (https://elabore.coop)
Maintainer
----------
This module is maintained by Elabore.

View File

@@ -0,0 +1 @@
from . import models

View File

@@ -0,0 +1,19 @@
{
"name": "hr_employee_stats_sheet_project_timesheet_holidays",
"version": "16.0.1.0.1",
"description": "Add global sheet for employee stats",
"summary": "Add global sheet for employee stats",
"author": "Nicolas JEUDY",
"website": "https://github.com/Alusage/odoo-hr-addons",
"license": "LGPL-3",
"category": "Human Resources",
"depends": [
"hr_employee_stats_sheet",
"project_timesheet_holidays",
],
"data": [
],
"installable": True,
"application": False,
"auto_install": True,
}

View File

@@ -0,0 +1 @@
from . import hr_employee_stats

View File

@@ -0,0 +1,14 @@
from odoo import models
class HrEmployeeStats(models.Model):
_inherit = "hr.employee.stats"
def get_total_hours_domain(self):
'''
if project_timesheet_holidays is installed, exclude timesheet generated from holidays to calculated total hours
'''
domain = super().get_total_hours_domain()
if self.env.company.leave_timesheet_task_id:
domain.append(("task_id", "!=", self.env.company.leave_timesheet_task_id.id),)
return domain