Skip to content

Commit

Permalink
Merge pull request #501 from brainbeanapps/12.0-add-hr_holidays_accrual
Browse files Browse the repository at this point in the history
[12.0][ADD] hr_holidays_accrual_advanced: Advanced accrual leave allocations
  • Loading branch information
pedrobaeza committed May 14, 2019
2 parents 563f281 + 3e93be2 commit cc2d7ec
Show file tree
Hide file tree
Showing 22 changed files with 2,421 additions and 0 deletions.
95 changes: 95 additions & 0 deletions hr_holidays_accrual_advanced/README.rst
@@ -0,0 +1,95 @@
===========================
Advanced Accrual Allocation
===========================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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-lightgray.png?logo=github
:target: https://github.com/OCA/hr/tree/12.0/hr_holidays_accrual_advanced
:alt: OCA/hr
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/hr-12-0/hr-12-0-hr_holidays_accrual_advanced
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/116/12.0
:alt: Try me on Runbot

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

This module provides advanced accrual leaves allocation as extension to
out-of-the-box per-employee accrual leave allocation capabilities of Odoo,
introducing following extra features:

* Accrual allocation history
* Accrual allocation calculator ("How many leave days I'll have in 3 months from today?")
* Various accrual methods
* Various limits to express complex corporate accrual leave policies
* Takes into account employee service period instead of ``create_date``

**Table of contents**

.. contents::
:local:

Usage
=====

This module is an almost-replacement of accrual feature from the
``hr_holidays`` module and its features are configured in the same manner
under the Leave Types menu.

Known issues / Roadmap
======================

This module overrides accruement computation from base Odoo ``hr_holidays``
module with its own, yet the provided implementation is backwards-compatible
with out-of-the-box Odoo behaviour.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/hr/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 <https://github.com/OCA/hr/issues/new?body=module:%20hr_holidays_accrual_advanced%0Aversion:%2012.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
~~~~~~~

* Brainbean Apps

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

* Alexey Pelykh <alexey.pelykh@brainbeanapps.com>

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 <https://github.com/OCA/hr/tree/12.0/hr_holidays_accrual_advanced>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions hr_holidays_accrual_advanced/__init__.py
@@ -0,0 +1,4 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from . import models
from . import wizards
27 changes: 27 additions & 0 deletions hr_holidays_accrual_advanced/__manifest__.py
@@ -0,0 +1,27 @@
# Copyright 2018-2019 Brainbean Apps (https://brainbeanapps.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

{
'name': 'Advanced Accrual Allocation',
'version': '12.0.1.0.0',
'category': 'Human Resources',
'website': 'https://github.com/OCA/hr',
'author':
'Brainbean Apps, '
'Odoo Community Association (OCA)',
'license': 'AGPL-3',
'installable': True,
'application': False,
'summary': 'Advanced accrual leaves allocation',
'depends': [
'hr_holidays',
'hr_employee_service',
],
'data': [
'security/hr_holidays_accrual_security.xml',
'security/ir.model.access.csv',
'wizards/hr_leave_allocation_accrual_calculator.xml',
'views/hr_leave_allocation.xml',
'views/hr_leave_allocation_accruement.xml',
],
}
6 changes: 6 additions & 0 deletions hr_holidays_accrual_advanced/models/__init__.py
@@ -0,0 +1,6 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from . import hr_leave
from . import hr_leave_allocation
from . import hr_leave_allocation_accruement
from . import resource_calendar_leaves
17 changes: 17 additions & 0 deletions hr_holidays_accrual_advanced/models/hr_leave.py
@@ -0,0 +1,17 @@
# Copyright 2018-2019 Brainbean Apps (https://brainbeanapps.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from odoo import models, fields


class HrLeave(models.Model):
_inherit = 'hr.leave'

time_type = fields.Selection(
related='holiday_status_id.time_type',
store=True,
)
unpaid = fields.Boolean(
related='holiday_status_id.unpaid',
store=True,
)

0 comments on commit cc2d7ec

Please sign in to comment.