From 823cea8f75e7efe3dbbcb74618fbbdc675381606 Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Tue, 24 Apr 2018 09:34:11 -0700 Subject: [PATCH 001/108] Initial commit `maintenance_notebook` for 11.0 --- maintenance_notebook/__init__.py | 1 + maintenance_notebook/__manifest__.py | 22 +++++++++++++++++++ .../views/maintenance_views.xml | 13 +++++++++++ 3 files changed, 36 insertions(+) create mode 100644 maintenance_notebook/__init__.py create mode 100644 maintenance_notebook/__manifest__.py create mode 100644 maintenance_notebook/views/maintenance_views.xml diff --git a/maintenance_notebook/__init__.py b/maintenance_notebook/__init__.py new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/maintenance_notebook/__init__.py @@ -0,0 +1 @@ + diff --git a/maintenance_notebook/__manifest__.py b/maintenance_notebook/__manifest__.py new file mode 100644 index 00000000..198c0fb6 --- /dev/null +++ b/maintenance_notebook/__manifest__.py @@ -0,0 +1,22 @@ +{ + 'name': 'Maintenance Notebook', + 'version': '11.0.1.0.0', + 'author': 'Hibou Corp. ', + 'category': 'Human Resources', + 'summary': 'Record time on maintenance requests.', + 'description': """ +Maintenance Notebook +==================== + +Adds a 'notebook' XML element to the Maintenance form to add pages in other modules. +""", + 'website': 'https://hibou.io/', + 'depends': [ + 'maintenance', + ], + 'data': [ + 'views/maintenance_views.xml', + ], + 'installable': True, + 'auto_install': False, +} diff --git a/maintenance_notebook/views/maintenance_views.xml b/maintenance_notebook/views/maintenance_views.xml new file mode 100644 index 00000000..e5558e18 --- /dev/null +++ b/maintenance_notebook/views/maintenance_views.xml @@ -0,0 +1,13 @@ + + + + equipment.request.form.notebook + maintenance.request + + + + + + + + \ No newline at end of file From 9b0b5d7b76501d1a3b95adc98000c4a2334876cb Mon Sep 17 00:00:00 2001 From: Kristen Marie Kulha Date: Mon, 11 Jun 2018 15:47:02 -0700 Subject: [PATCH 002/108] Add README to `maintenance_notebook`. --- maintenance_notebook/README.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 maintenance_notebook/README.rst diff --git a/maintenance_notebook/README.rst b/maintenance_notebook/README.rst new file mode 100644 index 00000000..1fbc238a --- /dev/null +++ b/maintenance_notebook/README.rst @@ -0,0 +1,22 @@ +**************************** +Hibou - Maintenance Notebook +**************************** + +Base module that creates tabs used in `maintenance_repair `_ and `maintenance_timesheet `_ + +For more information and add-ons, visit `Hibou.io `_. + + +.. image:: https://user-images.githubusercontent.com/15882954/41258483-2666f906-6d85-11e8-9f74-a50aaa6b527b.png + :alt: 'Equipment Detail' + :width: 988 + :align: left + + +======= +License +======= + +Please see `LICENSE `_. + +Copyright Hibou Corp. 2018 From 2cf3e51e06d86c79eaf7831e747eafc97c6a6b0a Mon Sep 17 00:00:00 2001 From: Bhoomi Date: Thu, 29 Aug 2019 10:17:31 -0400 Subject: [PATCH 003/108] MIG `maintenance_notebook` For Odoo 12.0 --- maintenance_notebook/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maintenance_notebook/__manifest__.py b/maintenance_notebook/__manifest__.py index 198c0fb6..c314bd7e 100644 --- a/maintenance_notebook/__manifest__.py +++ b/maintenance_notebook/__manifest__.py @@ -1,6 +1,6 @@ { 'name': 'Maintenance Notebook', - 'version': '11.0.1.0.0', + 'version': '12.0.1.0.0', 'author': 'Hibou Corp. ', 'category': 'Human Resources', 'summary': 'Record time on maintenance requests.', From 4932fbac73942a5b2149846c294f2c7f6f29f0dc Mon Sep 17 00:00:00 2001 From: Bhoomi Date: Fri, 30 Aug 2019 09:49:18 -0400 Subject: [PATCH 004/108] MIG `maintenance_notebook` For Odoo 13.0 --- maintenance_notebook/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maintenance_notebook/__manifest__.py b/maintenance_notebook/__manifest__.py index c314bd7e..bd80ef5b 100644 --- a/maintenance_notebook/__manifest__.py +++ b/maintenance_notebook/__manifest__.py @@ -1,6 +1,6 @@ { 'name': 'Maintenance Notebook', - 'version': '12.0.1.0.0', + 'version': '13.0.1.0.0', 'author': 'Hibou Corp. ', 'category': 'Human Resources', 'summary': 'Record time on maintenance requests.', From 0b490ba53b55a2bc86422ad714b31d3af4d2f215 Mon Sep 17 00:00:00 2001 From: Leo Pinedo Date: Tue, 25 Oct 2022 22:32:22 +0000 Subject: [PATCH 005/108] [MIG] maintenance_notebook: to 16 --- maintenance_notebook/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maintenance_notebook/__manifest__.py b/maintenance_notebook/__manifest__.py index bd80ef5b..db5d4380 100644 --- a/maintenance_notebook/__manifest__.py +++ b/maintenance_notebook/__manifest__.py @@ -1,6 +1,6 @@ { 'name': 'Maintenance Notebook', - 'version': '13.0.1.0.0', + 'version': '16.0.1.0.0', 'author': 'Hibou Corp. ', 'category': 'Human Resources', 'summary': 'Record time on maintenance requests.', From ad8996fa36215b079b6a91a684ab52beda1deb1a Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Tue, 1 May 2018 09:54:22 -0700 Subject: [PATCH 006/108] Initial commit `maintenance_purchase_detail` for 11.0 --- maintenance_purchase_detail/README.rst | 26 +++++++++++++++++++ maintenance_purchase_detail/__init__.py | 1 + maintenance_purchase_detail/__manifest__.py | 22 ++++++++++++++++ .../models/__init__.py | 1 + .../models/maintenance.py | 13 ++++++++++ .../views/maintenance_views.xml | 20 ++++++++++++++ 6 files changed, 83 insertions(+) create mode 100644 maintenance_purchase_detail/README.rst create mode 100644 maintenance_purchase_detail/__init__.py create mode 100644 maintenance_purchase_detail/__manifest__.py create mode 100644 maintenance_purchase_detail/models/__init__.py create mode 100644 maintenance_purchase_detail/models/maintenance.py create mode 100644 maintenance_purchase_detail/views/maintenance_views.xml diff --git a/maintenance_purchase_detail/README.rst b/maintenance_purchase_detail/README.rst new file mode 100644 index 00000000..0e081b44 --- /dev/null +++ b/maintenance_purchase_detail/README.rst @@ -0,0 +1,26 @@ +*********************************** +Hibou - Maintenance Purchase Detail +*********************************** + +Record purchase date and details on Equipments. + +For more information and add-ons, visit `Hibou.io `_. + +============= +Main Features +============= + +Adds the following fields to Maintenance Equipment: + +* Purchase Date +* Purchase Condition (dropdown) +* Purchase Note + +Additionally, adds a smart button to archive Equipments. + +======= +License +======= + +Please see `LICENSE `_. +Copyright Hibou Corp. 2018 \ No newline at end of file diff --git a/maintenance_purchase_detail/__init__.py b/maintenance_purchase_detail/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/maintenance_purchase_detail/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/maintenance_purchase_detail/__manifest__.py b/maintenance_purchase_detail/__manifest__.py new file mode 100644 index 00000000..e688ea32 --- /dev/null +++ b/maintenance_purchase_detail/__manifest__.py @@ -0,0 +1,22 @@ +{ + 'name': 'Equipment Purchase Detail', + 'version': '11.0.1.0.0', + 'author': 'Hibou Corp. ', + 'category': 'Human Resources', + 'summary': 'Record purchase date and details on Equipments.', + 'description': """ +Equipment Purchase Detail +========================= + +Adds fields for purchase date, and condition on the Equipment form. +""", + 'website': 'https://hibou.io/', + 'depends': [ + 'maintenance', + ], + 'data': [ + 'views/maintenance_views.xml', + ], + 'installable': True, + 'auto_install': False, +} diff --git a/maintenance_purchase_detail/models/__init__.py b/maintenance_purchase_detail/models/__init__.py new file mode 100644 index 00000000..12bf298f --- /dev/null +++ b/maintenance_purchase_detail/models/__init__.py @@ -0,0 +1 @@ +from . import maintenance diff --git a/maintenance_purchase_detail/models/maintenance.py b/maintenance_purchase_detail/models/maintenance.py new file mode 100644 index 00000000..cdf73d09 --- /dev/null +++ b/maintenance_purchase_detail/models/maintenance.py @@ -0,0 +1,13 @@ +from odoo import api, fields, models + + +class MaintenanceEquipment(models.Model): + _inherit = 'maintenance.equipment' + + purchase_date = fields.Date(string='Purchase Date') + purchase_condition = fields.Selection([ + ('new', 'New'), + ('used', 'Used'), + ('other', 'Other'), + ], string='Purchase Condition') + purchase_note = fields.Text(string='Purchase Note') diff --git a/maintenance_purchase_detail/views/maintenance_views.xml b/maintenance_purchase_detail/views/maintenance_views.xml new file mode 100644 index 00000000..5a2a9777 --- /dev/null +++ b/maintenance_purchase_detail/views/maintenance_views.xml @@ -0,0 +1,20 @@ + + + + equipment.form.inherited + maintenance.equipment + + + + + + + + + + + + + \ No newline at end of file From 488194ac4c99f71ef4f18d169324d0e65b9c6d67 Mon Sep 17 00:00:00 2001 From: Bhoomi Date: Fri, 13 Sep 2019 12:41:33 -0400 Subject: [PATCH 007/108] MIG `maintenance_purchase_detail` For Odoo 12.0 --- maintenance_purchase_detail/__manifest__.py | 2 +- maintenance_purchase_detail/views/maintenance_views.xml | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/maintenance_purchase_detail/__manifest__.py b/maintenance_purchase_detail/__manifest__.py index e688ea32..79508ba7 100644 --- a/maintenance_purchase_detail/__manifest__.py +++ b/maintenance_purchase_detail/__manifest__.py @@ -1,6 +1,6 @@ { 'name': 'Equipment Purchase Detail', - 'version': '11.0.1.0.0', + 'version': '12.0.1.0.0', 'author': 'Hibou Corp. ', 'category': 'Human Resources', 'summary': 'Record purchase date and details on Equipments.', diff --git a/maintenance_purchase_detail/views/maintenance_views.xml b/maintenance_purchase_detail/views/maintenance_views.xml index 5a2a9777..3a1bab21 100644 --- a/maintenance_purchase_detail/views/maintenance_views.xml +++ b/maintenance_purchase_detail/views/maintenance_views.xml @@ -5,12 +5,7 @@ maintenance.equipment - - - - + From 0aeab767ec6df6085e227e507134531be8e95792 Mon Sep 17 00:00:00 2001 From: Bhoomi Date: Fri, 13 Sep 2019 17:27:36 -0400 Subject: [PATCH 008/108] MIG `maintenance_purchase_detail` For Odoo 13.0 --- maintenance_purchase_detail/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maintenance_purchase_detail/__manifest__.py b/maintenance_purchase_detail/__manifest__.py index 79508ba7..5d6bce51 100644 --- a/maintenance_purchase_detail/__manifest__.py +++ b/maintenance_purchase_detail/__manifest__.py @@ -1,6 +1,6 @@ { 'name': 'Equipment Purchase Detail', - 'version': '12.0.1.0.0', + 'version': '13.0.1.0.0', 'author': 'Hibou Corp. ', 'category': 'Human Resources', 'summary': 'Record purchase date and details on Equipments.', From 878d7b2e795e5a0ff658c5547a3d1744444aefca Mon Sep 17 00:00:00 2001 From: Leo Pinedo Date: Tue, 25 Oct 2022 22:22:04 +0000 Subject: [PATCH 009/108] [MIG] maintenance_purchase_detail: to 16 --- maintenance_purchase_detail/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maintenance_purchase_detail/__manifest__.py b/maintenance_purchase_detail/__manifest__.py index 5d6bce51..162ca152 100644 --- a/maintenance_purchase_detail/__manifest__.py +++ b/maintenance_purchase_detail/__manifest__.py @@ -1,6 +1,6 @@ { 'name': 'Equipment Purchase Detail', - 'version': '13.0.1.0.0', + 'version': '16.0.1.0.0', 'author': 'Hibou Corp. ', 'category': 'Human Resources', 'summary': 'Record purchase date and details on Equipments.', From 1e02a3b51c04fbb6fc4ce0de6ddd27bb0d63899c Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Wed, 6 Oct 2021 05:51:27 -0700 Subject: [PATCH 010/108] [ADD] web_hibou_color: for Odoo 15.0 --- web_hibou_color/__init__.py | 0 web_hibou_color/__manifest__.py | 21 +++++++++++++++++++ .../src/legacy/scss/primary_variables.scss | 9 ++++++++ 3 files changed, 30 insertions(+) create mode 100644 web_hibou_color/__init__.py create mode 100644 web_hibou_color/__manifest__.py create mode 100644 web_hibou_color/static/src/legacy/scss/primary_variables.scss diff --git a/web_hibou_color/__init__.py b/web_hibou_color/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/web_hibou_color/__manifest__.py b/web_hibou_color/__manifest__.py new file mode 100644 index 00000000..3f4b0c68 --- /dev/null +++ b/web_hibou_color/__manifest__.py @@ -0,0 +1,21 @@ +{ + 'name': 'Web Hibou Color', + 'category': 'Hidden', + 'version': '15.0.1.0.0', + 'description': """ +Hibou Colors +============ + +This module modifies the web addon to provide alternative colors. + """, + 'depends': [ + 'web', + ], + 'auto_install': True, + 'assets': { + 'web._assets_primary_variables': [ + ('prepend', 'web_hibou_color/static/src/legacy/scss/primary_variables.scss'), + ], + }, + 'license': 'LGPL-3', +} diff --git a/web_hibou_color/static/src/legacy/scss/primary_variables.scss b/web_hibou_color/static/src/legacy/scss/primary_variables.scss new file mode 100644 index 00000000..d816e793 --- /dev/null +++ b/web_hibou_color/static/src/legacy/scss/primary_variables.scss @@ -0,0 +1,9 @@ + + +$o-hibou-color: #0a6fa2; +$o-hibou-primary-color: #038f8c; + +$o-brand-odoo: $o-hibou-color; +$o-brand-primary: $o-hibou-primary-color; +//$o-brand-secondary: #8f8f8f; +//$o-brand-lightsecondary: $o-gray-100; From 796db4cff279af7c6627e67d475454ef2248c02f Mon Sep 17 00:00:00 2001 From: Mishael De La Cruz Date: Tue, 2 Nov 2021 09:58:15 -0500 Subject: [PATCH 011/108] [I18N] multi: Initial Translations 15.0 --- web_hibou_color/i18n/es.po | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 web_hibou_color/i18n/es.po diff --git a/web_hibou_color/i18n/es.po b/web_hibou_color/i18n/es.po new file mode 100644 index 00000000..aab743cb --- /dev/null +++ b/web_hibou_color/i18n/es.po @@ -0,0 +1,15 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-10-12 01:59+0000\n" +"PO-Revision-Date: 2021-10-12 01:59+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" From 3cb9d633481c0cee7aa443dbcab59c5ba30a64a9 Mon Sep 17 00:00:00 2001 From: Leo Pinedo Date: Tue, 25 Oct 2022 17:34:52 +0000 Subject: [PATCH 012/108] [MIG] web_hibou_color: to 16 --- web_hibou_color/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_hibou_color/__manifest__.py b/web_hibou_color/__manifest__.py index 3f4b0c68..15b00b70 100644 --- a/web_hibou_color/__manifest__.py +++ b/web_hibou_color/__manifest__.py @@ -1,7 +1,7 @@ { 'name': 'Web Hibou Color', 'category': 'Hidden', - 'version': '15.0.1.0.0', + 'version': '16.0.1.0.0', 'description': """ Hibou Colors ============ From 5667b7da7ac008b17566bb130e23a8b292f48d9a Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Mon, 30 Apr 2018 08:15:31 -0700 Subject: [PATCH 013/108] Adding all from 11.0 https://github.com/hibou-io/odoo-hr-payroll hr_payroll_holidays hr_payroll_input_name_report hr_payroll_input_report hr_payroll_payment hr_payroll_timesheet hr_payslip_line_date l10n_us_fl_hr_payroll l10n_us_hr_payroll l10n_us_mo_hr_payroll l10n_us_oh_hr_payroll l10n_us_va_hr_payroll --- hr_payslip_line_date/__init__.py | 2 ++ hr_payslip_line_date/__manifest__.py | 24 ++++++++++++++++++++++++ hr_payslip_line_date/payslip.py | 7 +++++++ hr_payslip_line_date/payslip_view.xml | 18 ++++++++++++++++++ 4 files changed, 51 insertions(+) create mode 100755 hr_payslip_line_date/__init__.py create mode 100755 hr_payslip_line_date/__manifest__.py create mode 100755 hr_payslip_line_date/payslip.py create mode 100755 hr_payslip_line_date/payslip_view.xml diff --git a/hr_payslip_line_date/__init__.py b/hr_payslip_line_date/__init__.py new file mode 100755 index 00000000..c09f11e8 --- /dev/null +++ b/hr_payslip_line_date/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +from . import payslip diff --git a/hr_payslip_line_date/__manifest__.py b/hr_payslip_line_date/__manifest__.py new file mode 100755 index 00000000..a9100917 --- /dev/null +++ b/hr_payslip_line_date/__manifest__.py @@ -0,0 +1,24 @@ +# -*- encoding: utf-8 -*- +{ + 'name': 'Date on Payslip Lines', + 'author': 'Hibou Corp. ', + 'license': 'AGPL-3', + 'category': 'Human Resources', + 'depends': ['hr_payroll_account'], + 'version': '11.0.0.0.0', + 'description': """ +Date on Payslip Lines +===================== + + * Adds "Date Account" (date) field to payslip line from payslip + * Adds group by date to Payslip Line search view + * Allows filtering by "Date Account" for easy period reporting + """, + + 'auto_install': True, + 'website': 'https://hibou.io/', + 'data':[ + 'payslip_view.xml', + ], + 'installable': True +} diff --git a/hr_payslip_line_date/payslip.py b/hr_payslip_line_date/payslip.py new file mode 100755 index 00000000..7b55423e --- /dev/null +++ b/hr_payslip_line_date/payslip.py @@ -0,0 +1,7 @@ +from odoo import models, fields + + +class PayslipLine(models.Model): + _inherit = 'hr.payslip.line' + + date = fields.Date(string="Date Account", related='slip_id.date', store=True) \ No newline at end of file diff --git a/hr_payslip_line_date/payslip_view.xml b/hr_payslip_line_date/payslip_view.xml new file mode 100755 index 00000000..61f5ba18 --- /dev/null +++ b/hr_payslip_line_date/payslip_view.xml @@ -0,0 +1,18 @@ + + + + + hr.payslip.line.select + hr.payslip.line + 20 + + + + + + + + + + + From 401ecf34bbc185f06fd9f7365706868079a11eff Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Tue, 20 Nov 2018 08:45:20 -0800 Subject: [PATCH 014/108] IMP `hr_payslip_line_date` added dynamic date filters. --- hr_payslip_line_date/payslip_view.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hr_payslip_line_date/payslip_view.xml b/hr_payslip_line_date/payslip_view.xml index 61f5ba18..7a431425 100755 --- a/hr_payslip_line_date/payslip_view.xml +++ b/hr_payslip_line_date/payslip_view.xml @@ -8,6 +8,18 @@ + + + + + + + + + + + + From 6700b736fc0953f5b31474fdeb1a6aecdceab334 Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Wed, 21 Nov 2018 06:20:05 -0800 Subject: [PATCH 015/108] IMP `hr_payslip_line_date` more dynamic filters. --- hr_payslip_line_date/payslip_view.xml | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/hr_payslip_line_date/payslip_view.xml b/hr_payslip_line_date/payslip_view.xml index 7a431425..ec551bd4 100755 --- a/hr_payslip_line_date/payslip_view.xml +++ b/hr_payslip_line_date/payslip_view.xml @@ -10,19 +10,26 @@ - - - - + + + + + + + + + + + - - - - + + + + - + - + From 88422b9c98116836b158c544558d2a0d4e234466 Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Mon, 20 May 2019 15:54:00 -0700 Subject: [PATCH 016/108] MIG `hr_payslip_line_date` to 12.0 --- hr_payslip_line_date/__manifest__.py | 11 ++--- hr_payslip_line_date/payslip_view.xml | 66 +++++++++++++-------------- 2 files changed, 37 insertions(+), 40 deletions(-) diff --git a/hr_payslip_line_date/__manifest__.py b/hr_payslip_line_date/__manifest__.py index a9100917..1723d1de 100755 --- a/hr_payslip_line_date/__manifest__.py +++ b/hr_payslip_line_date/__manifest__.py @@ -1,23 +1,22 @@ -# -*- encoding: utf-8 -*- { 'name': 'Date on Payslip Lines', 'author': 'Hibou Corp. ', 'license': 'AGPL-3', 'category': 'Human Resources', 'depends': ['hr_payroll_account'], - 'version': '11.0.0.0.0', + 'version': '12.0.1.0.0', 'description': """ Date on Payslip Lines ===================== - * Adds "Date Account" (date) field to payslip line from payslip - * Adds group by date to Payslip Line search view - * Allows filtering by "Date Account" for easy period reporting +* Adds "Date Account" (date) field to payslip line from payslip +* Adds group by date to Payslip Line search view +* Allows filtering by "Date Account" for easy period reporting """, 'auto_install': True, 'website': 'https://hibou.io/', - 'data':[ + 'data': [ 'payslip_view.xml', ], 'installable': True diff --git a/hr_payslip_line_date/payslip_view.xml b/hr_payslip_line_date/payslip_view.xml index ec551bd4..790b5447 100755 --- a/hr_payslip_line_date/payslip_view.xml +++ b/hr_payslip_line_date/payslip_view.xml @@ -1,37 +1,35 @@ - - - hr.payslip.line.select - hr.payslip.line - 20 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + hr.payslip.line.select + hr.payslip.line + 20 + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 5c0b980d298e97b63c1696b3d4e4f1bab836c92e Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Fri, 3 Jul 2020 12:35:45 -0700 Subject: [PATCH 017/108] [MIG] hr_payslip_line_date: to Odoo 13.0 --- hr_payslip_line_date/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hr_payslip_line_date/__manifest__.py b/hr_payslip_line_date/__manifest__.py index 1723d1de..b67dfe15 100755 --- a/hr_payslip_line_date/__manifest__.py +++ b/hr_payslip_line_date/__manifest__.py @@ -4,7 +4,7 @@ 'license': 'AGPL-3', 'category': 'Human Resources', 'depends': ['hr_payroll_account'], - 'version': '12.0.1.0.0', + 'version': '13.0.1.0.0', 'description': """ Date on Payslip Lines ===================== From d0cabbad4206914fb8ad92fb3f24d58f0c712d5a Mon Sep 17 00:00:00 2001 From: Leighton Pennicott Date: Thu, 8 Oct 2020 16:31:39 -0400 Subject: [PATCH 018/108] [IMP] hr_payslip_line_date: Add hr_payslip_line_date to Odoo v13 Add the hr_payslip_line module to Odoo13 H3953 --- hr_payslip_line_date/__init__.py | 3 +- hr_payslip_line_date/__manifest__.py | 3 +- hr_payslip_line_date/models/__init__.py | 1 + hr_payslip_line_date/{ => models}/payslip.py | 0 hr_payslip_line_date/views/payslip_menu.xml | 15 +++++ hr_payslip_line_date/views/payslip_view.xml | 64 ++++++++++++++++++++ 6 files changed, 83 insertions(+), 3 deletions(-) mode change 100755 => 100644 hr_payslip_line_date/__init__.py create mode 100755 hr_payslip_line_date/models/__init__.py rename hr_payslip_line_date/{ => models}/payslip.py (100%) create mode 100644 hr_payslip_line_date/views/payslip_menu.xml create mode 100755 hr_payslip_line_date/views/payslip_view.xml diff --git a/hr_payslip_line_date/__init__.py b/hr_payslip_line_date/__init__.py old mode 100755 new mode 100644 index c09f11e8..0650744f --- a/hr_payslip_line_date/__init__.py +++ b/hr_payslip_line_date/__init__.py @@ -1,2 +1 @@ -# -*- coding: utf-8 -*- -from . import payslip +from . import models diff --git a/hr_payslip_line_date/__manifest__.py b/hr_payslip_line_date/__manifest__.py index b67dfe15..9864b715 100755 --- a/hr_payslip_line_date/__manifest__.py +++ b/hr_payslip_line_date/__manifest__.py @@ -17,7 +17,8 @@ Date on Payslip Lines 'auto_install': True, 'website': 'https://hibou.io/', 'data': [ - 'payslip_view.xml', + 'views/payslip_view.xml', + 'views/payslip_menu.xml', ], 'installable': True } diff --git a/hr_payslip_line_date/models/__init__.py b/hr_payslip_line_date/models/__init__.py new file mode 100755 index 00000000..305e17f9 --- /dev/null +++ b/hr_payslip_line_date/models/__init__.py @@ -0,0 +1 @@ +from . import payslip diff --git a/hr_payslip_line_date/payslip.py b/hr_payslip_line_date/models/payslip.py similarity index 100% rename from hr_payslip_line_date/payslip.py rename to hr_payslip_line_date/models/payslip.py diff --git a/hr_payslip_line_date/views/payslip_menu.xml b/hr_payslip_line_date/views/payslip_menu.xml new file mode 100644 index 00000000..b1a3e6f7 --- /dev/null +++ b/hr_payslip_line_date/views/payslip_menu.xml @@ -0,0 +1,15 @@ + + + + + + + + + \ No newline at end of file diff --git a/hr_payslip_line_date/views/payslip_view.xml b/hr_payslip_line_date/views/payslip_view.xml new file mode 100755 index 00000000..e36b50cd --- /dev/null +++ b/hr_payslip_line_date/views/payslip_view.xml @@ -0,0 +1,64 @@ + + + + + hr.payslip.line.select + hr.payslip.line + 20 + + + + + Last Month (Date From) + + + Last Quarter (Date From) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + hr.payslip.line.tree.extend + hr.payslip.line + + + + + + + + + True + + + + + + + + + + From 51397765b607defc7db41c0fab5bec658229b15a Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Thu, 6 Jan 2022 09:53:20 -0800 Subject: [PATCH 019/108] [MIG] hr_payslip_line_date: to 15.0 --- hr_payslip_line_date/__manifest__.py | 2 +- hr_payslip_line_date/models/payslip.py | 2 +- hr_payslip_line_date/views/payslip_menu.xml | 11 ++++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/hr_payslip_line_date/__manifest__.py b/hr_payslip_line_date/__manifest__.py index 9864b715..68a3582e 100755 --- a/hr_payslip_line_date/__manifest__.py +++ b/hr_payslip_line_date/__manifest__.py @@ -4,7 +4,7 @@ 'license': 'AGPL-3', 'category': 'Human Resources', 'depends': ['hr_payroll_account'], - 'version': '13.0.1.0.0', + 'version': '15.0.1.0.0', 'description': """ Date on Payslip Lines ===================== diff --git a/hr_payslip_line_date/models/payslip.py b/hr_payslip_line_date/models/payslip.py index 7b55423e..2162eaa3 100755 --- a/hr_payslip_line_date/models/payslip.py +++ b/hr_payslip_line_date/models/payslip.py @@ -4,4 +4,4 @@ from odoo import models, fields class PayslipLine(models.Model): _inherit = 'hr.payslip.line' - date = fields.Date(string="Date Account", related='slip_id.date', store=True) \ No newline at end of file + date = fields.Date(string="Date Account", related='slip_id.date', store=True) diff --git a/hr_payslip_line_date/views/payslip_menu.xml b/hr_payslip_line_date/views/payslip_menu.xml index b1a3e6f7..9647a00b 100644 --- a/hr_payslip_line_date/views/payslip_menu.xml +++ b/hr_payslip_line_date/views/payslip_menu.xml @@ -2,14 +2,15 @@ - + + Payslip Lines + hr.payslip.line + tree,pivot + + action="action_payslip_lines" /> \ No newline at end of file From 2b230923a45b0999a42fbc1e9e3c9f887d11ee4b Mon Sep 17 00:00:00 2001 From: Leo Pinedo Date: Tue, 25 Oct 2022 17:08:31 +0000 Subject: [PATCH 020/108] [MIG] hr_payslip_line_date: to 16 --- hr_payslip_line_date/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hr_payslip_line_date/__manifest__.py b/hr_payslip_line_date/__manifest__.py index 68a3582e..013977c5 100755 --- a/hr_payslip_line_date/__manifest__.py +++ b/hr_payslip_line_date/__manifest__.py @@ -4,7 +4,7 @@ 'license': 'AGPL-3', 'category': 'Human Resources', 'depends': ['hr_payroll_account'], - 'version': '15.0.1.0.0', + 'version': '16.0.1.0.0', 'description': """ Date on Payslip Lines ===================== From 5d099e68261cf5beac4fbac95a65779db1b5b5e5 Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Thu, 29 Oct 2020 11:25:45 -0700 Subject: [PATCH 021/108] [MOV] helpdesk_sales: from hibou-suite-enterprise:11.0 --- helpdesk_sales/__init__.py | 1 + helpdesk_sales/__manifest__.py | 22 ++++++++++++++++++++++ helpdesk_sales/models/__init__.py | 1 + helpdesk_sales/models/helpdesk.py | 15 +++++++++++++++ helpdesk_sales/views/helpdesk_views.xml | 20 ++++++++++++++++++++ 5 files changed, 59 insertions(+) create mode 100644 helpdesk_sales/__init__.py create mode 100755 helpdesk_sales/__manifest__.py create mode 100644 helpdesk_sales/models/__init__.py create mode 100644 helpdesk_sales/models/helpdesk.py create mode 100644 helpdesk_sales/views/helpdesk_views.xml diff --git a/helpdesk_sales/__init__.py b/helpdesk_sales/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/helpdesk_sales/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/helpdesk_sales/__manifest__.py b/helpdesk_sales/__manifest__.py new file mode 100755 index 00000000..008a5ac2 --- /dev/null +++ b/helpdesk_sales/__manifest__.py @@ -0,0 +1,22 @@ +{ + 'name': 'Helpdesk Sales', + 'summary': 'Adds smart button on Helpdesk Tickets to see and create Sale Orders', + 'version': '11.0.1.0.0', + 'author': "Hibou Corp.", + 'category': 'Helpdesk', + 'license': 'AGPL-3', + 'images': [], + 'website': "https://hibou.io", + 'description': "Adds smart button on Helpdesk Tickets to see and create Sale Orders", + 'depends': [ + 'helpdesk', + 'sale', + 'sale_management', + ], + 'demo': [], + 'data': [ + 'views/helpdesk_views.xml', + ], + 'auto_install': False, + 'installable': True, + } diff --git a/helpdesk_sales/models/__init__.py b/helpdesk_sales/models/__init__.py new file mode 100644 index 00000000..a3d4b803 --- /dev/null +++ b/helpdesk_sales/models/__init__.py @@ -0,0 +1 @@ +from . import helpdesk diff --git a/helpdesk_sales/models/helpdesk.py b/helpdesk_sales/models/helpdesk.py new file mode 100644 index 00000000..26b149ec --- /dev/null +++ b/helpdesk_sales/models/helpdesk.py @@ -0,0 +1,15 @@ +from odoo import api, models, fields + + +class Ticket(models.Model): + _inherit = 'helpdesk.ticket' + + sale_order_count = fields.Integer(related='partner_id.sale_order_count', string='# of Sale Orders') + + def action_partner_sales(self): + self.ensure_one() + action = self.env.ref('sale.act_res_partner_2_sale_order').read()[0] + action['context'] = { + 'search_default_partner_id': self.partner_id.id, + } + return action diff --git a/helpdesk_sales/views/helpdesk_views.xml b/helpdesk_sales/views/helpdesk_views.xml new file mode 100644 index 00000000..4f12041b --- /dev/null +++ b/helpdesk_sales/views/helpdesk_views.xml @@ -0,0 +1,20 @@ + + + + + + helpdesk.ticket.form.inherit + helpdesk.ticket + + + + + + + + + From a66b721cd9d2556adf09cf4f81b5421dad251e0c Mon Sep 17 00:00:00 2001 From: Connor Christian Date: Fri, 30 Oct 2020 15:00:54 -0400 Subject: [PATCH 022/108] [MIG] helpdesk_sales: for Odoo 12.0 Additionally hide button if there is no assigned customer --- helpdesk_sales/__manifest__.py | 2 +- helpdesk_sales/views/helpdesk_views.xml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/helpdesk_sales/__manifest__.py b/helpdesk_sales/__manifest__.py index 008a5ac2..134a6457 100755 --- a/helpdesk_sales/__manifest__.py +++ b/helpdesk_sales/__manifest__.py @@ -1,7 +1,7 @@ { 'name': 'Helpdesk Sales', 'summary': 'Adds smart button on Helpdesk Tickets to see and create Sale Orders', - 'version': '11.0.1.0.0', + 'version': '12.0.1.0.0', 'author': "Hibou Corp.", 'category': 'Helpdesk', 'license': 'AGPL-3', diff --git a/helpdesk_sales/views/helpdesk_views.xml b/helpdesk_sales/views/helpdesk_views.xml index 4f12041b..7fd09982 100644 --- a/helpdesk_sales/views/helpdesk_views.xml +++ b/helpdesk_sales/views/helpdesk_views.xml @@ -10,6 +10,7 @@ From e32fb4e7557835a014e7ea079664447f79056a79 Mon Sep 17 00:00:00 2001 From: Connor Christian Date: Fri, 30 Oct 2020 17:32:05 -0400 Subject: [PATCH 023/108] [MIG] helpdesk_sales: for Odoo 13.0 --- helpdesk_sales/__manifest__.py | 2 +- helpdesk_sales/views/helpdesk_views.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/helpdesk_sales/__manifest__.py b/helpdesk_sales/__manifest__.py index 134a6457..349334a8 100755 --- a/helpdesk_sales/__manifest__.py +++ b/helpdesk_sales/__manifest__.py @@ -1,7 +1,7 @@ { 'name': 'Helpdesk Sales', 'summary': 'Adds smart button on Helpdesk Tickets to see and create Sale Orders', - 'version': '12.0.1.0.0', + 'version': '13.0.1.0.0', 'author': "Hibou Corp.", 'category': 'Helpdesk', 'license': 'AGPL-3', diff --git a/helpdesk_sales/views/helpdesk_views.xml b/helpdesk_sales/views/helpdesk_views.xml index 7fd09982..3b0c3e5e 100644 --- a/helpdesk_sales/views/helpdesk_views.xml +++ b/helpdesk_sales/views/helpdesk_views.xml @@ -7,9 +7,9 @@ helpdesk.ticket - + From b6a2c297737ba9291cccbc867cc28333f6118785 Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Mon, 10 Jan 2022 08:39:15 -0800 Subject: [PATCH 082/108] [FIX] project_task_line: access error on action for low level users --- project_task_line/models/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project_task_line/models/project.py b/project_task_line/models/project.py index 91c1534f..887f53ab 100644 --- a/project_task_line/models/project.py +++ b/project_task_line/models/project.py @@ -15,7 +15,7 @@ class ProjectTask(models.Model): task.subtask_count_done = len(subtasks.filtered(lambda t: t.stage_id.is_closed)) def action_subtask(self): - action = self.env.ref('project.action_view_all_task').read()[0] + action = self.env.ref('project.action_view_all_task').sudo().read()[0] # display all subtasks of current task action['domain'] = [('id', 'child_of', self.id), ('id', '!=', self.id)] From b5fae7595f6413e2de4c946875d3f0ed71192dc5 Mon Sep 17 00:00:00 2001 From: Leo Pinedo Date: Fri, 21 Oct 2022 22:58:25 +0000 Subject: [PATCH 083/108] [MIG] project_task_line: to 16 --- project_task_line/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project_task_line/__manifest__.py b/project_task_line/__manifest__.py index 306dba71..d8023b12 100644 --- a/project_task_line/__manifest__.py +++ b/project_task_line/__manifest__.py @@ -1,6 +1,6 @@ { 'name': 'Project Task Lines', - 'version': '15.0.1.0.0', + 'version': '16.0.1.0.0', 'author': 'Hibou Corp. ', 'website': 'https://hibou.io/', 'license': 'AGPL-3', From 99d0d1cb551450d581c9e42b5e51d9da19c4f666 Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Fri, 18 Sep 2020 11:28:39 -0700 Subject: [PATCH 084/108] [NEW] hr_attendance_work_entry: for Odoo 13 --- hr_attendance_work_entry/__init__.py | 15 +++++ hr_attendance_work_entry/__manifest__.py | 17 ++++++ .../data/hr_attendance_work_entry_data.xml | 17 ++++++ hr_attendance_work_entry/models/__init__.py | 3 + hr_attendance_work_entry/models/attendance.py | 9 +++ hr_attendance_work_entry/models/employee.py | 58 +++++++++++++++++++ hr_attendance_work_entry/models/work_entry.py | 13 +++++ hr_attendance_work_entry/tests/__init__.py | 1 + .../tests/test_attendance_work_type.py | 47 +++++++++++++++ 9 files changed, 180 insertions(+) create mode 100644 hr_attendance_work_entry/__init__.py create mode 100755 hr_attendance_work_entry/__manifest__.py create mode 100644 hr_attendance_work_entry/data/hr_attendance_work_entry_data.xml create mode 100644 hr_attendance_work_entry/models/__init__.py create mode 100644 hr_attendance_work_entry/models/attendance.py create mode 100644 hr_attendance_work_entry/models/employee.py create mode 100644 hr_attendance_work_entry/models/work_entry.py create mode 100644 hr_attendance_work_entry/tests/__init__.py create mode 100644 hr_attendance_work_entry/tests/test_attendance_work_type.py diff --git a/hr_attendance_work_entry/__init__.py b/hr_attendance_work_entry/__init__.py new file mode 100644 index 00000000..26c033a8 --- /dev/null +++ b/hr_attendance_work_entry/__init__.py @@ -0,0 +1,15 @@ +from . import models + + +def attn_payroll_pre_init_hook(cr): + """ + This module installs a Work Entry Type with code "ATTN" + If you have undergone a migration (either for this module + or even your own Payslip Work Entry lines with code "ATTN") + then the uniqueness constraint will prevent this module + from installing. + """ + cr.execute("UPDATE hr_work_entry_type " + "SET code = 'ATTN-PRE-INSTALL' " + "WHERE code = 'ATTN';" + ) diff --git a/hr_attendance_work_entry/__manifest__.py b/hr_attendance_work_entry/__manifest__.py new file mode 100755 index 00000000..97d1d7ab --- /dev/null +++ b/hr_attendance_work_entry/__manifest__.py @@ -0,0 +1,17 @@ +{ + 'name': 'Attendance Work Entry Type', + 'description': 'Set work types on attendance records.', + 'version': '13.0.1.0.0', + 'website': 'https://hibou.io/', + 'author': 'Hibou Corp. ', + 'license': 'AGPL-3', + 'category': 'Human Resources', + 'data': [ + 'data/hr_attendance_work_entry_data.xml', + ], + 'depends': [ + 'hr_attendance', + 'hr_work_entry', + ], + 'pre_init_hook': 'attn_payroll_pre_init_hook', +} diff --git a/hr_attendance_work_entry/data/hr_attendance_work_entry_data.xml b/hr_attendance_work_entry/data/hr_attendance_work_entry_data.xml new file mode 100644 index 00000000..ab99a1ca --- /dev/null +++ b/hr_attendance_work_entry/data/hr_attendance_work_entry_data.xml @@ -0,0 +1,17 @@ + + + + + Attendance + ATTN + + checked_in + fa-sign-in + + + + + Work Calendar + + + \ No newline at end of file diff --git a/hr_attendance_work_entry/models/__init__.py b/hr_attendance_work_entry/models/__init__.py new file mode 100644 index 00000000..1e37c49d --- /dev/null +++ b/hr_attendance_work_entry/models/__init__.py @@ -0,0 +1,3 @@ +from . import attendance +from . import employee +from . import work_entry diff --git a/hr_attendance_work_entry/models/attendance.py b/hr_attendance_work_entry/models/attendance.py new file mode 100644 index 00000000..273b1367 --- /dev/null +++ b/hr_attendance_work_entry/models/attendance.py @@ -0,0 +1,9 @@ +from odoo import fields, models + + +class HrAttendance(models.Model): + _inherit = 'hr.attendance' + + work_type_id = fields.Many2one('hr.work.entry.type', string='Work Type', + default=lambda self: self.env.ref('hr_attendance_work_entry.work_input_attendance', + raise_if_not_found=False)) diff --git a/hr_attendance_work_entry/models/employee.py b/hr_attendance_work_entry/models/employee.py new file mode 100644 index 00000000..d9caffc4 --- /dev/null +++ b/hr_attendance_work_entry/models/employee.py @@ -0,0 +1,58 @@ +from odoo import api, fields, models, _ +from odoo.exceptions import UserError + + +class HrEmployee(models.Model): + _inherit = 'hr.employee' + + attendance_state = fields.Selection(selection_add=[('break', 'Break')]) + + @api.depends('last_attendance_id.work_type_id') + def _compute_attendance_state(self): + for employee in self: + att = employee.last_attendance_id.sudo() + if not att or att.check_out: + employee.attendance_state = 'checked_out' + elif employee.last_attendance_id.work_type_id.attendance_state: + employee.attendance_state = employee.last_attendance_id.work_type_id.attendance_state + else: + employee.attendance_state = 'checked_in' + + def attendance_manual(self, next_action, entered_pin=None, work_type_id=None): + self = self.with_context(work_type_id=work_type_id) + return super(HrEmployee, self).attendance_manual(next_action, entered_pin=entered_pin) + + def _attendance_action_change(self): + """ Check In/Check Out action + Check In: create a new attendance record + Check Out: modify check_out field of appropriate attendance record + """ + self.ensure_one() + action_date = fields.Datetime.now() + work_type_id = self._context.get('work_type_id', False) + + if self.attendance_state == 'checked_out': + vals = { + 'employee_id': self.id, + 'check_in': action_date, + } + if work_type_id: + # if we don't have a work_type_id, we want the default + vals['work_type_id'] = work_type_id + return self.env['hr.attendance'].create(vals) + attendance = self.env['hr.attendance'].search([('employee_id', '=', self.id), ('check_out', '=', False)], limit=1) + if attendance and work_type_id: + # work_type_id is the "next" attendance type + attendance.check_out = action_date + vals = { + 'employee_id': self.id, + 'check_in': action_date, + 'work_type_id': work_type_id, + } + return self.env['hr.attendance'].create(vals) + if attendance: + attendance.check_out = action_date + else: + raise UserError(_('Cannot perform check out on %(empl_name)s, could not find corresponding check in. ' + 'Your attendances have probably been modified manually by human resources.') % {'empl_name': self.sudo().name, }) + return attendance diff --git a/hr_attendance_work_entry/models/work_entry.py b/hr_attendance_work_entry/models/work_entry.py new file mode 100644 index 00000000..b4088b0e --- /dev/null +++ b/hr_attendance_work_entry/models/work_entry.py @@ -0,0 +1,13 @@ +from odoo import fields, models + + +class HrWorkEntryType(models.Model): + _inherit = 'hr.work.entry.type' + + allow_attendance = fields.Boolean(string='Allow in Attendance') + attendance_icon = fields.Char(string='Attendance Icon', default='fa-sign-in') + attendance_state = fields.Selection([ + # ('checked_out', "Checked out"), # reserved for detecting new punch in + ('checked_in', "Checked in"), + ('break', 'Break'), + ], string='Attendance State', default='checked_in') diff --git a/hr_attendance_work_entry/tests/__init__.py b/hr_attendance_work_entry/tests/__init__.py new file mode 100644 index 00000000..170aaad8 --- /dev/null +++ b/hr_attendance_work_entry/tests/__init__.py @@ -0,0 +1 @@ +from . import test_attendance_work_type diff --git a/hr_attendance_work_entry/tests/test_attendance_work_type.py b/hr_attendance_work_entry/tests/test_attendance_work_type.py new file mode 100644 index 00000000..3b739d6d --- /dev/null +++ b/hr_attendance_work_entry/tests/test_attendance_work_type.py @@ -0,0 +1,47 @@ +from odoo.tests import common + + +class TestAttendanceWorkType(common.TransactionCase): + def setUp(self): + super().setUp() + self.employee = self.env.ref('hr.employee_hne') + self.default_work_type = self.env.ref('hr_attendance_work_entry.work_input_attendance') + + def test_01_work_type(self): + attendance = self.env['hr.attendance'].create({ + 'employee_id': self.employee.id, + 'check_in': '2020-01-06 10:00:00', # Monday + 'check_out': '2020-01-06 19:00:00', + }) + self.assertTrue(attendance.work_type_id) + self.assertEqual(attendance.work_type_id, self.default_work_type) + + def test_11_employee_clock_in(self): + self.assertEqual(self.employee.attendance_state, 'checked_out') + attendance = self.employee._attendance_action_change() + self.assertEqual(attendance.work_type_id, self.default_work_type) + self.assertEqual(self.employee.attendance_state, 'checked_in') + + # check out + self.employee._attendance_action_change() + self.assertEqual(self.employee.attendance_state, 'checked_out') + + def test_12_employee_clock_in_break(self): + # check in with non-standard work type + break_type = self.env['hr.work.entry.type'].create({ + 'name': 'Test Break', + 'code': 'TESTBREAK', + 'allow_attendance': True, + 'attendance_state': 'break', + }) + self.employee = self.employee.with_context(work_type_id=break_type.id) + attendance = self.employee._attendance_action_change() + self.assertEqual(attendance.work_type_id, break_type) + self.assertEqual(self.employee.attendance_state, 'break') + + # check back in immediately with default + self.employee = self.employee.with_context(work_type_id=self.default_work_type.id) + attendance = self.employee._attendance_action_change() + self.assertEqual(attendance.work_type_id, self.default_work_type) + self.assertEqual(attendance.work_type_id.attendance_state, 'checked_in') + self.assertEqual(self.employee.attendance_state, 'checked_in') From 54455afb85d46273dbc560275714e65ccbb83d40 Mon Sep 17 00:00:00 2001 From: Brett Spaulding Date: Fri, 18 Sep 2020 17:26:50 -0400 Subject: [PATCH 085/108] [IMP] hr_attendance_work_entry: Modified kiosk mode views and attendance views to allow for various punch types. --- hr_attendance_work_entry/__manifest__.py | 16 ++- .../data/hr_attendance_work_entry_demo.xml | 20 +++ hr_attendance_work_entry/models/attendance.py | 7 +- hr_attendance_work_entry/models/employee.py | 5 +- hr_attendance_work_entry/models/work_entry.py | 2 + .../static/src/js/kiosk_confirm.js | 71 ++++++++++ .../static/src/js/my_attendances.js | 50 +++++++ .../static/src/scss/hr_attendances.scss | 31 ++++ .../static/src/xml/hr_attendance.xml | 134 ++++++++++++++++++ .../views/attendance_views.xml | 15 ++ .../views/employee_views.xml | 58 ++++++++ hr_attendance_work_entry/views/web_assets.xml | 14 ++ .../views/work_entry_views.xml | 36 +++++ 13 files changed, 454 insertions(+), 5 deletions(-) create mode 100644 hr_attendance_work_entry/data/hr_attendance_work_entry_demo.xml create mode 100644 hr_attendance_work_entry/static/src/js/kiosk_confirm.js create mode 100644 hr_attendance_work_entry/static/src/js/my_attendances.js create mode 100644 hr_attendance_work_entry/static/src/scss/hr_attendances.scss create mode 100644 hr_attendance_work_entry/static/src/xml/hr_attendance.xml create mode 100644 hr_attendance_work_entry/views/attendance_views.xml create mode 100644 hr_attendance_work_entry/views/employee_views.xml create mode 100644 hr_attendance_work_entry/views/web_assets.xml create mode 100644 hr_attendance_work_entry/views/work_entry_views.xml diff --git a/hr_attendance_work_entry/__manifest__.py b/hr_attendance_work_entry/__manifest__.py index 97d1d7ab..61ab485f 100755 --- a/hr_attendance_work_entry/__manifest__.py +++ b/hr_attendance_work_entry/__manifest__.py @@ -6,12 +6,22 @@ 'author': 'Hibou Corp. ', 'license': 'AGPL-3', 'category': 'Human Resources', - 'data': [ - 'data/hr_attendance_work_entry_data.xml', - ], 'depends': [ 'hr_attendance', 'hr_work_entry', ], + 'data': [ + 'data/hr_attendance_work_entry_data.xml', + 'views/attendance_views.xml', + 'views/employee_views.xml', + 'views/web_assets.xml', + 'views/work_entry_views.xml', + ], + 'demo': [ + 'data/hr_attendance_work_entry_demo.xml', + ], + 'qweb': [ + 'static/src/xml/hr_attendance.xml', + ], 'pre_init_hook': 'attn_payroll_pre_init_hook', } diff --git a/hr_attendance_work_entry/data/hr_attendance_work_entry_demo.xml b/hr_attendance_work_entry/data/hr_attendance_work_entry_demo.xml new file mode 100644 index 00000000..e88356b2 --- /dev/null +++ b/hr_attendance_work_entry/data/hr_attendance_work_entry_demo.xml @@ -0,0 +1,20 @@ + + + + + Break + ATTN_BREAK + + break + fa-hourglass-1 + + + + Lunch + ATTN_LUNCH + + lunch + fa-coffee + + + \ No newline at end of file diff --git a/hr_attendance_work_entry/models/attendance.py b/hr_attendance_work_entry/models/attendance.py index 273b1367..cd0d35b5 100644 --- a/hr_attendance_work_entry/models/attendance.py +++ b/hr_attendance_work_entry/models/attendance.py @@ -1,4 +1,4 @@ -from odoo import fields, models +from odoo import api, fields, models class HrAttendance(models.Model): @@ -7,3 +7,8 @@ class HrAttendance(models.Model): work_type_id = fields.Many2one('hr.work.entry.type', string='Work Type', default=lambda self: self.env.ref('hr_attendance_work_entry.work_input_attendance', raise_if_not_found=False)) + + @api.model + def gather_attendance_work_types(self): + work_types = self.env['hr.work.entry.type'].sudo().search([('allow_attendance', '=', True)]) + return work_types.read(['id', 'name', 'attendance_icon']) diff --git a/hr_attendance_work_entry/models/employee.py b/hr_attendance_work_entry/models/employee.py index d9caffc4..49edc1d6 100644 --- a/hr_attendance_work_entry/models/employee.py +++ b/hr_attendance_work_entry/models/employee.py @@ -5,7 +5,7 @@ from odoo.exceptions import UserError class HrEmployee(models.Model): _inherit = 'hr.employee' - attendance_state = fields.Selection(selection_add=[('break', 'Break')]) + attendance_state = fields.Selection(selection_add=[('break', 'Break'), ('lunch', 'Lunch')]) @api.depends('last_attendance_id.work_type_id') def _compute_attendance_state(self): @@ -20,6 +20,9 @@ class HrEmployee(models.Model): def attendance_manual(self, next_action, entered_pin=None, work_type_id=None): self = self.with_context(work_type_id=work_type_id) + if not entered_pin: + # fix for pin mode with specific argument order for work_type_id + entered_pin = None return super(HrEmployee, self).attendance_manual(next_action, entered_pin=entered_pin) def _attendance_action_change(self): diff --git a/hr_attendance_work_entry/models/work_entry.py b/hr_attendance_work_entry/models/work_entry.py index b4088b0e..73618223 100644 --- a/hr_attendance_work_entry/models/work_entry.py +++ b/hr_attendance_work_entry/models/work_entry.py @@ -3,6 +3,7 @@ from odoo import fields, models class HrWorkEntryType(models.Model): _inherit = 'hr.work.entry.type' + _order = 'sequence, id' allow_attendance = fields.Boolean(string='Allow in Attendance') attendance_icon = fields.Char(string='Attendance Icon', default='fa-sign-in') @@ -10,4 +11,5 @@ class HrWorkEntryType(models.Model): # ('checked_out', "Checked out"), # reserved for detecting new punch in ('checked_in', "Checked in"), ('break', 'Break'), + ('lunch', 'Lunch'), ], string='Attendance State', default='checked_in') diff --git a/hr_attendance_work_entry/static/src/js/kiosk_confirm.js b/hr_attendance_work_entry/static/src/js/kiosk_confirm.js new file mode 100644 index 00000000..8919f0e3 --- /dev/null +++ b/hr_attendance_work_entry/static/src/js/kiosk_confirm.js @@ -0,0 +1,71 @@ +odoo.define('hr_attendance_work_entry.kiosk_confirm', function (require) { +"use strict"; + +var core = require('web.core'); +var KioskConfirm = require('hr_attendance.kiosk_confirm'); +var KioskConfirmTyped = KioskConfirm.extend({ + events: _.extend({}, KioskConfirm.prototype.events, { + "click .o_hr_attendance_punch_type": _.debounce(function(e) { + var work_entry_type = $(e.target).data('work-entry-type'); + this.update_attendance(work_entry_type); + }, 200, true), + "click .o_hr_attendance_pin_pad_button_work": _.debounce(function(e) { + var work_entry_type = $(e.target).data('work-entry-type'); + this.update_attendance_pin(work_entry_type); + }, 200, true), + }), + willStart: function () { + var self = this; + + var def = this._rpc({ + model: 'hr.attendance', + method: 'gather_attendance_work_types', + args: []}) + .then(function (res) { + self.work_types = res; + }); + + return Promise.all([def, this._super.apply(this, arguments)]); + }, + update_attendance: function (type) { + var self = this; + this._rpc({ + model: 'hr.employee', + method: 'attendance_manual', + args: [[self.employee_id], this.next_action, false, type], + }) + .then(function(result) { + if (result.action) { + self.do_action(result.action); + } else if (result.warning) { + self.do_warn(result.warning); + } + }); + }, + update_attendance_pin: function (type) { + var self = this; + this.$('.o_hr_attendance_pin_pad_button_ok').attr("disabled", "disabled"); + this.$('.o_hr_attendance_pin_pad_button_work').attr("disabled", "disabled"); + this._rpc({ + model: 'hr.employee', + method: 'attendance_manual', + args: [[this.employee_id], this.next_action, this.$('.o_hr_attendance_PINbox').val(), type], + }) + .then(function(result) { + if (result.action) { + self.do_action(result.action); + } else if (result.warning) { + self.do_warn(result.warning); + self.$('.o_hr_attendance_PINbox').val(''); + setTimeout( function() { + self.$('.o_hr_attendance_pin_pad_button_ok').removeAttr("disabled"); + self.$('.o_hr_attendance_pin_pad_button_work').removeAttr("disabled"); + }, 500); + } + }); + }, +}); + +core.action_registry.add('hr_attendance_kiosk_confirm', KioskConfirmTyped); +return KioskConfirmTyped; +}); \ No newline at end of file diff --git a/hr_attendance_work_entry/static/src/js/my_attendances.js b/hr_attendance_work_entry/static/src/js/my_attendances.js new file mode 100644 index 00000000..d9dcf7ac --- /dev/null +++ b/hr_attendance_work_entry/static/src/js/my_attendances.js @@ -0,0 +1,50 @@ +odoo.define('hr_attendance_work_entry.my_attendances', function (require) { +"use strict"; + +var core = require('web.core'); +var MyAttendances = require('hr_attendance.my_attendances'); + +var MyTypedAttendances = MyAttendances.extend({ + events: _.extend({}, MyAttendances.prototype.events, { + "click .o_hr_attendance_punch_type": _.debounce(function(e) { + var work_entry_type = $(e.target).data('work-entry-type'); + this.update_attendance(work_entry_type); + }, 200, true), + }), + + willStart: function () { + var self = this; + + var def = this._rpc({ + model: 'hr.attendance', + method: 'gather_attendance_work_types', + args: []}) + .then(function (res) { + self.work_types = res; + }); + + return Promise.all([def, this._super.apply(this, arguments)]); + }, + + update_attendance: function (type) { + var self = this; + this._rpc({ + model: 'hr.employee', + method: 'attendance_manual', + args: [[self.employee.id], 'hr_attendance.hr_attendance_action_my_attendances', false, type], + }) + .then(function(result) { + if (result.action) { + self.do_action(result.action); + } else if (result.warning) { + self.do_warn(result.warning); + } + }); + }, +}); + +core.action_registry.add('hr_attendance_my_attendances', MyTypedAttendances); + +return MyTypedAttendances; + +}); \ No newline at end of file diff --git a/hr_attendance_work_entry/static/src/scss/hr_attendances.scss b/hr_attendance_work_entry/static/src/scss/hr_attendances.scss new file mode 100644 index 00000000..308412de --- /dev/null +++ b/hr_attendance_work_entry/static/src/scss/hr_attendances.scss @@ -0,0 +1,31 @@ +.o_hr_attendance_sign_in_out_icon { + cursor: pointer; + border-radius: .1em; + box-shadow: inset 0 -3px 0 fade-out(black, 0.7); + + &.btn-secondary:hover { + color: $o-brand-primary; + } +} + +#oe_hr_attendance_status { + color: $o-brand-secondary; + + &.oe_hr_attendance_status_blue { + color: theme-color('info'); + } + + &.oe_hr_attendance_status_orange { + color: theme-color('warning'); + } +} + +.o_hr_attendance_kiosk_mode p.o_hr_attendance_continue { + margin-bottom: 0; + text-align: center; + font-weight: bold; +} + +.o_hr_attendance_pin_pad_button_work { + font-size: 0.9em; +} diff --git a/hr_attendance_work_entry/static/src/xml/hr_attendance.xml b/hr_attendance_work_entry/static/src/xml/hr_attendance.xml new file mode 100644 index 00000000..e356c106 --- /dev/null +++ b/hr_attendance_work_entry/static/src/xml/hr_attendance.xml @@ -0,0 +1,134 @@ + + + + + +
+ + + +
+ +
+

+

Welcome! + Want to check out?

+

Today's work hours:

+
+
+ +
+ + + +

+ Or, continue working as: +

+ + + + + + + +
+ +
+
+
+ + Warning : Your user should be linked to an employee to use attendance. Please contact your administrator. + +
+ +
+
+ + + +