diff --git a/hr_attendance_overtime_manual/README.rst b/hr_attendance_overtime_manual/README.rst new file mode 100644 index 00000000..17213059 --- /dev/null +++ b/hr_attendance_overtime_manual/README.rst @@ -0,0 +1,78 @@ +============================= +HR Attendance Overtime Manual +============================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:485c8e17e0ff09ca329335f04a83a8ee20ab90706eb6ff5d415b11bd13410a1a + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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--attendance-lightgray.png?logo=github + :target: https://github.com/OCA/hr-attendance/tree/16.0/hr_attendance_overtime_manual + :alt: OCA/hr-attendance +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/hr-attendance-16-0/hr-attendance-16-0-hr_attendance_overtime_manual + :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-attendance&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This modules allows the attendance managers to create overtimes manually for employee +using a wizard. It further unlocks the view for the overtimes to be also visible if +the total is <= 0. + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* initOS GmbH + +Contributors +~~~~~~~~~~~~ + +* initOS GmbH (initOS.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-attendance `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/hr_attendance_overtime_manual/__init__.py b/hr_attendance_overtime_manual/__init__.py new file mode 100644 index 00000000..836f46f5 --- /dev/null +++ b/hr_attendance_overtime_manual/__init__.py @@ -0,0 +1,4 @@ +# © 2023 initOS GmbH +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import models, wizard diff --git a/hr_attendance_overtime_manual/__manifest__.py b/hr_attendance_overtime_manual/__manifest__.py new file mode 100644 index 00000000..68752c81 --- /dev/null +++ b/hr_attendance_overtime_manual/__manifest__.py @@ -0,0 +1,22 @@ +# © 2023 initOS GmbH +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "HR Attendance Overtime Manual", + "version": "16.0.1.0.0", + "category": "Hidden", + "author": "initOS GmbH, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/hr-attendance", + "license": "AGPL-3", + "summary": "Allows adding manual overtime records", + "depends": [ + "hr_attendance", + ], + "data": [ + "security/ir.model.access.csv", + "views/hr_attendance_overtime_views.xml", + "views/hr_employee_views.xml", + "wizard/hr_attendance_overtime_manual_wizard_views.xml", + ], + "installable": True, +} diff --git a/hr_attendance_overtime_manual/i18n/de.po b/hr_attendance_overtime_manual/i18n/de.po new file mode 100644 index 00000000..96bcea1a --- /dev/null +++ b/hr_attendance_overtime_manual/i18n/de.po @@ -0,0 +1,77 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_attendance_overtime_manual +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-08-04 07:04+0000\n" +"PO-Revision-Date: 2023-08-04 07:04+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_overtime_manual +#: model:ir.actions.act_window,name:hr_attendance_overtime_manual.open_hr_attendance_overtime_wizard +msgid "Add Attendance Overtime" +msgstr "Überstunden hinzufügen" + +#. module: hr_attendance_overtime_manual +#: code:addons/hr_attendance_overtime_manual/models/hr_attendance_overtime.py:0 +#: model_terms:ir.ui.view,arch_db:hr_attendance_overtime_manual.view_employee_form +#: model_terms:ir.ui.view,arch_db:hr_attendance_overtime_manual.view_attendance_overtime_manual_form +#, python-format +msgid "Add Manual Overtime" +msgstr "Manuelle Überstunden hinzufügen" + +#. module: hr_attendance_overtime_manual +#: model:ir.model,name:hr_attendance_overtime_manual.model_hr_attendance_overtime +msgid "Attendance Overtime" +msgstr "Überstunden" + +#. module: hr_attendance_overtime_manual +#: model_terms:ir.ui.view,arch_db:hr_attendance_overtime_manual.view_attendance_overtime_manual_form +msgid "Close" +msgstr "Schließen" + +#. module: hr_attendance_overtime_manual +#: model_terms:ir.ui.view,arch_db:hr_attendance_overtime_manual.view_attendance_overtime_manual_form +msgid "Create Overtime" +msgstr "Überstunden anlegen" + +#. module: hr_attendance_overtime_manual +#: model:ir.model.fields,field_description:hr_attendance_overtime_manual.field_hr_attendance_overtime_wizard__date +msgid "Day" +msgstr "Tag" + +#. module: hr_attendance_overtime_manual +#: model:ir.model,name:hr_attendance_overtime_manual.model_hr_employee +msgid "Employee" +msgstr "Mitarbeiter" + +#. module: hr_attendance_overtime_manual +#: model:ir.model.fields,field_description:hr_attendance_overtime_manual.field_hr_attendance_overtime_wizard__duration +msgid "Extra Hours" +msgstr "Überstunden" + +#. module: hr_attendance_overtime_manual +#: model:ir.model.fields,field_description:hr_attendance_overtime_manual.field_hr_attendance_overtime__note +#: model:ir.model.fields,field_description:hr_attendance_overtime_manual.field_hr_attendance_overtime_wizard__note +msgid "Note" +msgstr "Notiz" + +#. module: hr_attendance_overtime_manual +#: code:addons/hr_attendance_overtime_manual/wizard/hr_attendance_overtime_manual_wizard.py:0 +#: model:ir.model,name:hr_attendance_overtime_manual.model_hr_attendance_overtime_wizard +#, python-format +msgid "Wizard to add manual overtime" +msgstr "Wizard um Überstunden hinzuzufügen" + +#. module: hr_attendance_overtime_manual +#: model_terms:ir.ui.view,arch_db:hr_attendance_overtime_manual.view_attendance_overtime_manual_form +msgid "or" +msgstr "oder" diff --git a/hr_attendance_overtime_manual/i18n/hr_attendance_overtime_manual.pot b/hr_attendance_overtime_manual/i18n/hr_attendance_overtime_manual.pot new file mode 100644 index 00000000..535caf0f --- /dev/null +++ b/hr_attendance_overtime_manual/i18n/hr_attendance_overtime_manual.pot @@ -0,0 +1,77 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_attendance_overtime_manual +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-08-04 07:04+0000\n" +"PO-Revision-Date: 2023-08-04 07:04+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_overtime_manual +#: model:ir.actions.act_window,name:hr_attendance_overtime_manual.open_hr_attendance_overtime_wizard +msgid "Add Attendance Overtime" +msgstr "" + +#. module: hr_attendance_overtime_manual +#: code:addons/hr_attendance_overtime_manual/models/hr_attendance_overtime.py:0 +#: model_terms:ir.ui.view,arch_db:hr_attendance_overtime_manual.view_employee_form +#: model_terms:ir.ui.view,arch_db:hr_attendance_overtime_manual.view_attendance_overtime_manual_form +#, python-format +msgid "Add Manual Overtime" +msgstr "" + +#. module: hr_attendance_overtime_manual +#: model:ir.model,name:hr_attendance_overtime_manual.model_hr_attendance_overtime +msgid "Attendance Overtime" +msgstr "" + +#. module: hr_attendance_overtime_manual +#: model_terms:ir.ui.view,arch_db:hr_attendance_overtime_manual.view_attendance_overtime_manual_form +msgid "Close" +msgstr "" + +#. module: hr_attendance_overtime_manual +#: model_terms:ir.ui.view,arch_db:hr_attendance_overtime_manual.view_attendance_overtime_manual_form +msgid "Create Overtime" +msgstr "" + +#. module: hr_attendance_overtime_manual +#: model:ir.model.fields,field_description:hr_attendance_overtime_manual.field_hr_attendance_overtime_wizard__date +msgid "Day" +msgstr "" + +#. module: hr_attendance_overtime_manual +#: model:ir.model,name:hr_attendance_overtime_manual.model_hr_employee +msgid "Employee" +msgstr "" + +#. module: hr_attendance_overtime_manual +#: model:ir.model.fields,field_description:hr_attendance_overtime_manual.field_hr_attendance_overtime_wizard__duration +msgid "Extra Hours" +msgstr "" + +#. module: hr_attendance_overtime_manual +#: model:ir.model.fields,field_description:hr_attendance_overtime_manual.field_hr_attendance_overtime__note +#: model:ir.model.fields,field_description:hr_attendance_overtime_manual.field_hr_attendance_overtime_wizard__note +msgid "Note" +msgstr "" + +#. module: hr_attendance_overtime_manual +#: code:addons/hr_attendance_overtime_manual/wizard/hr_attendance_overtime_manual_wizard.py:0 +#: model:ir.model,name:hr_attendance_overtime_manual.model_hr_attendance_overtime_wizard +#, python-format +msgid "Wizard to add manual overtime" +msgstr "" + +#. module: hr_attendance_overtime_manual +#: model_terms:ir.ui.view,arch_db:hr_attendance_overtime_manual.view_attendance_overtime_manual_form +msgid "or" +msgstr "" diff --git a/hr_attendance_overtime_manual/models/__init__.py b/hr_attendance_overtime_manual/models/__init__.py new file mode 100644 index 00000000..7cc3768e --- /dev/null +++ b/hr_attendance_overtime_manual/models/__init__.py @@ -0,0 +1,4 @@ +# © 2023 initOS GmbH +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import hr_attendance_overtime diff --git a/hr_attendance_overtime_manual/models/hr_attendance_overtime.py b/hr_attendance_overtime_manual/models/hr_attendance_overtime.py new file mode 100644 index 00000000..649b1cf4 --- /dev/null +++ b/hr_attendance_overtime_manual/models/hr_attendance_overtime.py @@ -0,0 +1,10 @@ +# © 2023 initOS GmbH +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class HrAttendanceOvertime(models.Model): + _inherit = "hr.attendance.overtime" + + note = fields.Char() diff --git a/hr_attendance_overtime_manual/readme/CONTRIBUTORS.rst b/hr_attendance_overtime_manual/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..db386db6 --- /dev/null +++ b/hr_attendance_overtime_manual/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* initOS GmbH (initOS.com) diff --git a/hr_attendance_overtime_manual/readme/DESCRIPTION.rst b/hr_attendance_overtime_manual/readme/DESCRIPTION.rst new file mode 100644 index 00000000..2f837e4b --- /dev/null +++ b/hr_attendance_overtime_manual/readme/DESCRIPTION.rst @@ -0,0 +1,3 @@ +This modules allows the attendance managers to create overtimes manually for employee +using a wizard. It further unlocks the view for the overtimes to be also visible if +the total is <= 0. diff --git a/hr_attendance_overtime_manual/security/ir.model.access.csv b/hr_attendance_overtime_manual/security/ir.model.access.csv new file mode 100644 index 00000000..fa658698 --- /dev/null +++ b/hr_attendance_overtime_manual/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +hr_attendance_overtime_manual.hr_attendance_overtime_wizard,hr_attendance_overtime_wizard,hr_attendance_overtime_manual.model_hr_attendance_overtime_wizard,hr_attendance.group_hr_attendance_user,1,1,1,1 diff --git a/hr_attendance_overtime_manual/static/description/index.html b/hr_attendance_overtime_manual/static/description/index.html new file mode 100644 index 00000000..db8578a6 --- /dev/null +++ b/hr_attendance_overtime_manual/static/description/index.html @@ -0,0 +1,423 @@ + + + + + + +HR Attendance Overtime Manual + + + +
+

HR Attendance Overtime Manual

+ + +

Beta License: AGPL-3 OCA/hr-attendance Translate me on Weblate Try me on Runboat

+

This modules allows the attendance managers to create overtimes manually for employee +using a wizard. It further unlocks the view for the overtimes to be also visible if +the total is <= 0.

+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • initOS GmbH
  • +
+
+
+

Contributors

+
    +
  • initOS GmbH (initOS.com)
  • +
+
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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-attendance project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/hr_attendance_overtime_manual/tests/__init__.py b/hr_attendance_overtime_manual/tests/__init__.py new file mode 100644 index 00000000..aacc51de --- /dev/null +++ b/hr_attendance_overtime_manual/tests/__init__.py @@ -0,0 +1,4 @@ +# © 2023 initOS GmbH +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import test_wizard diff --git a/hr_attendance_overtime_manual/tests/test_wizard.py b/hr_attendance_overtime_manual/tests/test_wizard.py new file mode 100644 index 00000000..2082bb55 --- /dev/null +++ b/hr_attendance_overtime_manual/tests/test_wizard.py @@ -0,0 +1,31 @@ +# © 2023 initOS GmbH +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from datetime import date + +from odoo.tests import TransactionCase + + +class TestWizard(TransactionCase): + def test_wizard(self): + employee = self.env.ref("hr.employee_admin") + before = self.env["hr.attendance.overtime"].search( + [("employee_id", "=", employee.id)] + ) + wizard = self.env["hr.attendance.overtime.wizard"].create( + { + "date": date(2023, 1, 1), + "duration": 4.2, + "note": "Manually created", + } + ) + + wizard.with_context(active_id=employee.id).action_create() + after = self.env["hr.attendance.overtime"].search( + [("employee_id", "=", employee.id)] + ) + overtime = after - before + self.assertEqual(len(overtime), 1) + + self.assertEqual(overtime.duration, 4.2) + self.assertEqual(overtime.note, "Manually created") diff --git a/hr_attendance_overtime_manual/views/hr_attendance_overtime_views.xml b/hr_attendance_overtime_manual/views/hr_attendance_overtime_views.xml new file mode 100644 index 00000000..169f0957 --- /dev/null +++ b/hr_attendance_overtime_manual/views/hr_attendance_overtime_views.xml @@ -0,0 +1,12 @@ + + + + hr.attendance.overtime + + + + + + + + diff --git a/hr_attendance_overtime_manual/views/hr_employee_views.xml b/hr_attendance_overtime_manual/views/hr_employee_views.xml new file mode 100644 index 00000000..49e596a5 --- /dev/null +++ b/hr_attendance_overtime_manual/views/hr_employee_views.xml @@ -0,0 +1,40 @@ + + + + Add Attendance Overtime + hr.attendance.overtime.wizard + form + new + + + + hr.employee + + + +