Skip to content

Commit

Permalink
[ADD] hr_timesheet_holiday_analysis: analyse timesheet entries by Is-…
Browse files Browse the repository at this point in the history
…Leave attribute
  • Loading branch information
alexey-pelykh committed Jan 3, 2019
1 parent b7b6fa8 commit 10b4ad2
Show file tree
Hide file tree
Showing 11 changed files with 573 additions and 0 deletions.
74 changes: 74 additions & 0 deletions hr_timesheet_holiday_analysis/README.rst
@@ -0,0 +1,74 @@
===================================
Timesheet when on Leaves (analysis)
===================================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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--timesheet-lightgray.png?logo=github
:target: https://github.com/OCA/hr-timesheet/tree/12.0/hr_timesheet_holiday_analysis
:alt: OCA/hr-timesheet
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/hr-timesheet-12-0/hr-timesheet-12-0-hr_timesheet_holiday_analysis
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/117/12.0
:alt: Try me on Runbot

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

This module allows to filter and group timesheet entries by when-on-leave
attribute.

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/hr-timesheet/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-timesheet/issues/new?body=module:%20hr_timesheet_holiday_analysis%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-timesheet <https://github.com/OCA/hr-timesheet/tree/12.0/hr_timesheet_holiday_analysis>`_ 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_timesheet_holiday_analysis/__init__.py
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

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

{
'name': 'Timesheet when on Leaves (analysis)',
'version': '12.0.1.0.0',
'category': 'Human Resources',
'website': 'https://github.com/OCA/hr-timesheet',
'author':
'Brainbean Apps, '
'Odoo Community Association (OCA)',
'license': 'AGPL-3',
'installable': True,
'application': False,
'summary': 'Analyse Timesheet-when-on-Leaves entries',
'depends': [
'project_timesheet_holidays',
],
'data': [
'views/account_analytic_line.xml',
],
}
3 changes: 3 additions & 0 deletions hr_timesheet_holiday_analysis/models/__init__.py
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from . import account_analytic_line
20 changes: 20 additions & 0 deletions hr_timesheet_holiday_analysis/models/account_analytic_line.py
@@ -0,0 +1,20 @@
# Copyright 2018 Brainbean Apps (https://brainbeanapps.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


class AccountAnalyticLine(models.Model):
_inherit = 'account.analytic.line'

is_leave = fields.Boolean(
string='Is Leave',
compute='_compute_is_leave',
store=True,
)

@api.multi
@api.depends('holiday_id')
def _compute_is_leave(self): # pragma: no cover
for line in self:
line.is_leave = bool(line.holiday_id)
1 change: 1 addition & 0 deletions hr_timesheet_holiday_analysis/readme/CONTRIBUTORS.rst
@@ -0,0 +1 @@
* Alexey Pelykh <alexey.pelykh@brainbeanapps.com>
2 changes: 2 additions & 0 deletions hr_timesheet_holiday_analysis/readme/DESCRIPTION.rst
@@ -0,0 +1,2 @@
This module allows to filter and group timesheet entries by when-on-leave
attribute.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 10b4ad2

Please sign in to comment.