Skip to content

Commit

Permalink
[15.0][ADD] hr_holidays_overview and hr_holidays_overview_public
Browse files Browse the repository at this point in the history
  • Loading branch information
StephaneMangin committed Jan 9, 2025
1 parent 6da361b commit c26e93f
Show file tree
Hide file tree
Showing 45 changed files with 1,990 additions and 0 deletions.
155 changes: 155 additions & 0 deletions hr_holidays_overview/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
====================
HR Holidays Overview
====================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:2447756d1107009e7523524148af7d9a5aa4eb4b50a1b1417c2817923222a4c1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fhr--holidays-lightgray.png?logo=github
:target: https://github.com/OCA/hr-holidays/tree/15.0/hr_holidays_overview
:alt: OCA/hr-holidays
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/hr-holidays-15-0/hr-holidays-15-0-hr_holidays_overview
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/hr-holidays&target_branch=15.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

The main purpose of this dashboard is to allow employee and manager to have an overview of their time off according to their allocations.

This dashboard will cover the time off with the purpose to have an overview of the time off allocated versus the time off taken.

Detailed requirements
=====================

Dashboard Leaves report
-----------------------

Should show the allocated time off and the time off request with an aggregation per time off type / employee / date available per hours or days.
The sum of both colum (allocated/request) will represent the time of available for request.

In order that the employee see easily the current situation by default the view should filter data according the following rules:

- Leaves from archived time off type should be hide by default
- By default we see only the planned time off (allocation_type is fixed or fixed_allocation) and the option should be to add the unplanned (allocation_type is no) or see only the unplanned
- The default view should be by leave_type (and not date)

Global requirement
------------------
The data coming from the time off should always represent the situation we get if we go to the time off app (I mean by here that the data should be in real time).

At the initialisation the system should be able to generate the past data.

Security
--------

The employee should not see the data from the others employee.
One exception for a manager that can see all the data from employees he is the manager of.

Pitfalls
========

- Limit cases about hours on weekend and hours worked at night inbetween 2 days.

Technical Details
=================

* On ``hr.employee.hour`` model:
* Override ``_compute_name_id`` to update name for non leaves type
* Add ``unplanned`` boolean field related
* Add ``state`` selection field
* Add new selection options for ``type`` field

* On ``hr.leave.allocation`` model:
* Override method ``prepare_hr_employee_hour_values`` to update values before create

* On ``hr.leave.type`` model:
* Override ``write`` method to archive ``hr.employee.hour`` related to the leave type

* On ``hr.leave`` model:
* Override method ``prepare_hr_employee_hour_values`` to update values before create

* On ``account.analytic.line`` model:
* Override method ``prepare_hr_employee_hour_values`` to update values before create

* On ``hr.employee.hour.report`` model:
* Add new selection options for ``type`` field
* Update ``WHERE`` query method to use the ``type`` field

* On ``hr.employee.leave.report`` model:
* Add ``unplanned`` boolean field related
* Add ``state`` selection field
* Add ``dayofweek`` char field
* Add new selection options for ``type`` field

**Table of contents**

.. contents::
:local:

Usage
=====

To generate employee hours lines at first install:

# Go to *HR Report Dashboard* > *Update HR Employee hours*

Then select the employees and the period you want to generate the lines for.
You also select only certain hour types:
- Contractual
- Timesheet
- Holiday


Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/hr-holidays/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/hr-holidays/issues/new?body=module:%20hr_holidays_overview%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Camptocamp SA

Contributors
~~~~~~~~~~~~

* Stéphane Mangin <[email protected]>

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/hr-holidays <https://github.com/OCA/hr-holidays/tree/15.0/hr_holidays_overview>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions hr_holidays_overview/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import models
from . import report
from . import wizards
19 changes: 19 additions & 0 deletions hr_holidays_overview/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2024 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "HR Holidays Overview",
"version": "15.0.1.3.0",
"license": "AGPL-3",
"category": "Human Resources",
"website": "https://github.com/OCA/hr-holidays",
"author": "Camptocamp SA, Odoo Community Association (OCA)",
"depends": ["hr_timesheet_overview", "project_timesheet_holidays"],
"data": [
"security/ir.model.access.csv",
"views/hr_employee_hour_views.xml",
"wizards/hr_employee_hour_updater_view.xml",
"report/hr_employee_leave_report_views.xml",
],
"installable": True,
}
Loading

0 comments on commit c26e93f

Please sign in to comment.