diff --git a/hr_zk_attendance/__manifest__.py b/hr_zk_attendance/__manifest__.py index 2f8212d76..44b4ca5a5 100644 --- a/hr_zk_attendance/__manifest__.py +++ b/hr_zk_attendance/__manifest__.py @@ -21,7 +21,7 @@ ################################################################################ { 'name': 'Biometric Device Integration', - 'version': '17.0.1.1.1', + 'version': '17.0.1.2.2', 'category': 'Human Resources', 'summary': "Integrating Biometric Device (Model: ZKteco uFace 202) With HR" "Attendance (Face + Thumb)", @@ -40,6 +40,7 @@ 'views/hr_employee_views.xml', 'views/daily_attendance_views.xml', 'views/biometric_device_attendance_menus.xml', + 'data/download_data.xml' ], 'images': ['static/description/banner.png'], 'license': 'AGPL-3', diff --git a/hr_zk_attendance/data/download_data.xml b/hr_zk_attendance/data/download_data.xml new file mode 100644 index 000000000..a4ef97dc4 --- /dev/null +++ b/hr_zk_attendance/data/download_data.xml @@ -0,0 +1,14 @@ + + + + Download Data + + + 10 + minutes + -1 + + code + model.cron_download() + + diff --git a/hr_zk_attendance/doc/RELEASE_NOTES.md b/hr_zk_attendance/doc/RELEASE_NOTES.md index 2b3f1672d..e2f418f1a 100755 --- a/hr_zk_attendance/doc/RELEASE_NOTES.md +++ b/hr_zk_attendance/doc/RELEASE_NOTES.md @@ -11,3 +11,9 @@ ##### UPDT - Added a new feature to Set the timezone for the device. + +#### 31.07.2024 +#### Version 17.0.1.2.2 +##### UPDT + +- Added a new feature to schedule attendance downloading diff --git a/hr_zk_attendance/models/biometric_device_details.py b/hr_zk_attendance/models/biometric_device_details.py index 83b6b7b5a..0b3e5fcd0 100644 --- a/hr_zk_attendance/models/biometric_device_details.py +++ b/hr_zk_attendance/models/biometric_device_details.py @@ -22,7 +22,7 @@ import datetime import logging import pytz -from odoo import fields, models, _ +from odoo import api, fields, models, _ from odoo.exceptions import UserError, ValidationError _logger = logging.getLogger(__name__) @@ -74,6 +74,7 @@ class BiometricDeviceDetails(models.Model): } except Exception as error: raise ValidationError(f'{error}') + def action_set_timezone(self): """Function to set user's timezone to device""" for info in self: @@ -109,7 +110,6 @@ class BiometricDeviceDetails(models.Model): raise UserError(_( "Please Check the Connection")) - def action_clear_attendance(self): """Methode to clear record from the zk.machine.attendance model and from the device""" @@ -146,6 +146,12 @@ class BiometricDeviceDetails(models.Model): except Exception as error: raise ValidationError(f'{error}') + @api.model + def cron_download(self): + machines = self.env['biometric.device.details'].search([]) + for machine in machines: + machine.action_download_attendance() + def action_download_attendance(self): """Function to download attendance records from the device""" _logger.info("++++++++++++Cron Executed++++++++++++++++++++++")