Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD] hr_attendance_resume_of: New menu "Imputations resume R". #67

Open
wants to merge 1 commit into
base: 12.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions hr_attendance_resume_of/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

=======================
Hr attendance resume of
=======================

* New menu "Imputations resume R". The new menu option for this object is
found in Attendances - Manage attendances - Imputations resume R. To see this
new menu option, the user must be in the group "Attendance-User".

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

Bugs are tracked on `GitHub Issues
<https://github.com/avanzosc/hr-addons/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smash it by providing detailed and welcomed feedback.

Credits
=======

Contributors
------------
* Ana Juaristi <[email protected]>
* Alfredo de la Fuente <[email protected]>

Do not contact contributors directly about support or help with technical issues.
3 changes: 3 additions & 0 deletions hr_attendance_resume_of/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Copyright 2019 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from . import models
18 changes: 18 additions & 0 deletions hr_attendance_resume_of/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2019 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
"name": "Hr Attendance Resume OF",
"version": "12.0.1.0.0",
"license": "AGPL-3",
"depends": [
"hr_attendance_resume_anomaly",
"resource_gesalaga",
],
"author": "AvanzOSC",
"website": "http://www.avanzosc.es",
"category": "Human Resources",
"data": [
"views/hr_attendance_resume_view.xml",
],
"installable": True,
}
46 changes: 46 additions & 0 deletions hr_attendance_resume_of/_common.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright 2019 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from datetime import date as datetype
from dateutil.relativedelta import relativedelta
from pytz import timezone, utc
from odoo import fields

str2datetime = fields.Datetime.from_string
date2str = fields.Date.to_string


def _convert_to_local_date(date, tz=u'UTC'):
if not date:
return False
if not tz:
tz = u'UTC'
new_date = str2datetime(date) if isinstance(date, str) else date
new_date = new_date.replace(tzinfo=utc)
local_date = new_date.astimezone(timezone(tz)).replace(tzinfo=None)
return local_date


def _convert_time_to_float(date, tz=u'UTC'):
if not date:
return False
if not tz:
tz = u'UTC'
local_time = _convert_to_local_date(date, tz=tz)
hour = float(local_time.hour)
minutes = float(local_time.minute) / 60
seconds = float(local_time.second) / 360
return (hour + minutes + seconds)


def _convert_to_utc_date(date, time=0.0, tz=u'UTC'):
if not date:
return False
if not tz:
tz = u'UTC'
date = date2str(date) if isinstance(date, datetype) else date
date = str2datetime(date) if isinstance(date, str) else date
date += relativedelta(hours=float(time))
local = timezone(tz)
local_date = local.localize(date, is_dst=None)
utc_date = local_date.astimezone(utc).replace(tzinfo=None)
return utc_date
103 changes: 103 additions & 0 deletions hr_attendance_resume_of/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_attendance_resume_of
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-03-03 13:40+0000\n"
"PO-Revision-Date: 2020-03-03 13:40+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: hr_attendance_resume_of
#: model:ir.model,name:hr_attendance_resume_of.model_hr_attendance
msgid "Attendance"
msgstr "Asistencia"

#. module: hr_attendance_resume_of
#: model:ir.model.fields,field_description:hr_attendance_resume_of.field_hr_attendance_resume__difference_hours_of
msgid "Difference hours"
msgstr "Diferencia horas"

#. module: hr_attendance_resume_of
#: model:ir.model.fields,field_description:hr_attendance_resume_of.field_hr_attendance_resume__difference_minutes_of
msgid "Difference minutes"
msgstr "Diferencia minutos"

#. module: hr_attendance_resume_of
#: model:ir.model,name:hr_attendance_resume_of.model_hr_employee
msgid "Employee"
msgstr "Empleado"

#. module: hr_attendance_resume_of
#: model:ir.model,name:hr_attendance_resume_of.model_hr_attendance_resume
msgid "Hours imputations resume"
msgstr "Resumen horas imputaciones"

#. module: hr_attendance_resume_of
#: model:ir.model.fields,field_description:hr_attendance_resume_of.field_hr_attendance_resume__imputable_time_of
msgid "Imputable time of"
msgstr "Tiempo imputable"

#. module: hr_attendance_resume_of
#: model:ir.actions.act_window,name:hr_attendance_resume_of.action_hr_attendance_resume_of
#: model:ir.ui.menu,name:hr_attendance_resume_of.hr_attendance_resume_of_group_view
msgid "Imputations resume R"
msgstr "Resumen imputaciones R"

#. module: hr_attendance_resume_of
#: model:ir.model.fields,field_description:hr_attendance_resume_of.field_hr_attendance_resume__markings_of
msgid "Markings of (E=Entrance, O=Output)"
msgstr "Fichajes (E=Entrada, S=Salida)"

#. module: hr_attendance_resume_of
#: model:ir.model.fields,field_description:hr_attendance_resume_of.field_hr_attendance_resume__presence_time_of
msgid "Presence time of"
msgstr "Tiempo presencia"

#. module: hr_attendance_resume_of
#: model:ir.model.fields,field_description:hr_attendance_resume_of.field_hr_attendance_resume__theoretical_time_final_of
msgid "Theoretical time"
msgstr "Tiempo teorico"

#. module: hr_attendance_resume_of
#: model:ir.model.fields,field_description:hr_attendance_resume_of.field_hr_attendance__theoretical_time_of
#: model:ir.model.fields,field_description:hr_attendance_resume_of.field_hr_attendance_resume__theoretical_time_of
msgid "Theoretical time of"
msgstr "Tiempo teorico"

#. module: hr_attendance_resume_of
#: model:ir.model,name:hr_attendance_resume_of.model_resource_calendar_attendance
msgid "Work Detail"
msgstr "Detalle del trabajo"

#. module: hr_attendance_resume_of
#: model:ir.model.fields,field_description:hr_attendance_resume_of.field_hr_attendance_resume__work_time_of
#: model:ir.model.fields,field_description:hr_attendance_resume_of.field_resource_calendar_attendance__work_time_of
msgid "Work time of"
msgstr "Tiempo trabajo"

#. module: hr_attendance_resume_of
#: code:addons/hr_attendance_resume_of/models/hr_attendance.py:230
#, python-format
msgid "{}/{}:{}E{}:{}O"
msgstr ""

#. module: hr_attendance_resume_of
#: code:addons/hr_attendance_resume_of/models/hr_attendance.py:218
#, python-format
msgid "{}:{}E{}:{}O"
msgstr ""

#. module: hr_attendance_resume_of
#: code:addons/hr_attendance_resume_of/models/hr_attendance.py:224
#, python-format
msgid "{}{}:{}E{}:{}O"
msgstr ""

103 changes: 103 additions & 0 deletions hr_attendance_resume_of/i18n/hr_attendance_resume_of.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_attendance_resume_of
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-03-03 13:39+0000\n"
"PO-Revision-Date: 2020-03-03 13:39+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: hr_attendance_resume_of
#: model:ir.model,name:hr_attendance_resume_of.model_hr_attendance
msgid "Attendance"
msgstr ""

#. module: hr_attendance_resume_of
#: model:ir.model.fields,field_description:hr_attendance_resume_of.field_hr_attendance_resume__difference_hours_of
msgid "Difference hours"
msgstr ""

#. module: hr_attendance_resume_of
#: model:ir.model.fields,field_description:hr_attendance_resume_of.field_hr_attendance_resume__difference_minutes_of
msgid "Difference minutes"
msgstr ""

#. module: hr_attendance_resume_of
#: model:ir.model,name:hr_attendance_resume_of.model_hr_employee
msgid "Employee"
msgstr ""

#. module: hr_attendance_resume_of
#: model:ir.model,name:hr_attendance_resume_of.model_hr_attendance_resume
msgid "Hours imputations resume"
msgstr ""

#. module: hr_attendance_resume_of
#: model:ir.model.fields,field_description:hr_attendance_resume_of.field_hr_attendance_resume__imputable_time_of
msgid "Imputable time of"
msgstr ""

#. module: hr_attendance_resume_of
#: model:ir.actions.act_window,name:hr_attendance_resume_of.action_hr_attendance_resume_of
#: model:ir.ui.menu,name:hr_attendance_resume_of.hr_attendance_resume_of_group_view
msgid "Imputations resume R"
msgstr ""

#. module: hr_attendance_resume_of
#: model:ir.model.fields,field_description:hr_attendance_resume_of.field_hr_attendance_resume__markings_of
msgid "Markings of (E=Entrance, O=Output)"
msgstr ""

#. module: hr_attendance_resume_of
#: model:ir.model.fields,field_description:hr_attendance_resume_of.field_hr_attendance_resume__presence_time_of
msgid "Presence time of"
msgstr ""

#. module: hr_attendance_resume_of
#: model:ir.model.fields,field_description:hr_attendance_resume_of.field_hr_attendance_resume__theoretical_time_final_of
msgid "Theoretical time"
msgstr ""

#. module: hr_attendance_resume_of
#: model:ir.model.fields,field_description:hr_attendance_resume_of.field_hr_attendance__theoretical_time_of
#: model:ir.model.fields,field_description:hr_attendance_resume_of.field_hr_attendance_resume__theoretical_time_of
msgid "Theoretical time of"
msgstr ""

#. module: hr_attendance_resume_of
#: model:ir.model,name:hr_attendance_resume_of.model_resource_calendar_attendance
msgid "Work Detail"
msgstr ""

#. module: hr_attendance_resume_of
#: model:ir.model.fields,field_description:hr_attendance_resume_of.field_hr_attendance_resume__work_time_of
#: model:ir.model.fields,field_description:hr_attendance_resume_of.field_resource_calendar_attendance__work_time_of
msgid "Work time of"
msgstr ""

#. module: hr_attendance_resume_of
#: code:addons/hr_attendance_resume_of/models/hr_attendance.py:230
#, python-format
msgid "{}/{}:{}E{}:{}O"
msgstr ""

#. module: hr_attendance_resume_of
#: code:addons/hr_attendance_resume_of/models/hr_attendance.py:218
#, python-format
msgid "{}:{}E{}:{}O"
msgstr ""

#. module: hr_attendance_resume_of
#: code:addons/hr_attendance_resume_of/models/hr_attendance.py:224
#, python-format
msgid "{}{}:{}E{}:{}O"
msgstr ""

5 changes: 5 additions & 0 deletions hr_attendance_resume_of/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2019 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from . import hr_attendance
from . import resource_calendar_attendance
from . import hr_employee
Loading