diff --git a/hr_zk_attendance/__init__.py b/hr_zk_attendance/__init__.py index d9e93b8e8..d4013ea10 100644 --- a/hr_zk_attendance/__init__.py +++ b/hr_zk_attendance/__init__.py @@ -3,7 +3,7 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Copyright (C) 2024-TODAY Cybrosys Technologies(). # Author: Ammu Raj (odoo@cybrosys.com) # # You can modify it under the terms of the GNU AFFERO diff --git a/hr_zk_attendance/__manifest__.py b/hr_zk_attendance/__manifest__.py index 2bf81e5f0..2f8212d76 100644 --- a/hr_zk_attendance/__manifest__.py +++ b/hr_zk_attendance/__manifest__.py @@ -3,7 +3,7 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Copyright (C) 2024-TODAY Cybrosys Technologies(). # Author: Ammu Raj (odoo@cybrosys.com) # # You can modify it under the terms of the GNU AFFERO @@ -21,7 +21,7 @@ ################################################################################ { 'name': 'Biometric Device Integration', - 'version': '17.0.1.0.0', + 'version': '17.0.1.1.1', 'category': 'Human Resources', 'summary': "Integrating Biometric Device (Model: ZKteco uFace 202) With HR" "Attendance (Face + Thumb)", diff --git a/hr_zk_attendance/doc/RELEASE_NOTES.md b/hr_zk_attendance/doc/RELEASE_NOTES.md index 6da9a8e65..2b3f1672d 100755 --- a/hr_zk_attendance/doc/RELEASE_NOTES.md +++ b/hr_zk_attendance/doc/RELEASE_NOTES.md @@ -5,3 +5,9 @@ ##### ADD - Initial commit for Biometric Device Integration + +#### 31.07.2024 +#### Version 17.0.1.1.1 +##### UPDT + +- Added a new feature to Set the timezone for the device. diff --git a/hr_zk_attendance/models/__init__.py b/hr_zk_attendance/models/__init__.py index 6478dcf9f..b91b1a08c 100644 --- a/hr_zk_attendance/models/__init__.py +++ b/hr_zk_attendance/models/__init__.py @@ -3,7 +3,7 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Copyright (C) 2024-TODAY Cybrosys Technologies(). # Author: Ammu Raj (odoo@cybrosys.com) # # You can modify it under the terms of the GNU AFFERO diff --git a/hr_zk_attendance/models/biometric_device_details.py b/hr_zk_attendance/models/biometric_device_details.py index 0d07df37e..83b6b7b5a 100644 --- a/hr_zk_attendance/models/biometric_device_details.py +++ b/hr_zk_attendance/models/biometric_device_details.py @@ -3,7 +3,7 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Copyright (C) 2024-TODAY Cybrosys Technologies(). # Author: Ammu Raj (odoo@cybrosys.com) # # You can modify it under the terms of the GNU AFFERO @@ -74,6 +74,41 @@ 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: + machine_ip = info.device_ip + zk_port = info.port_number + try: + # Connecting with the device with the ip and port provided + zk = ZK(machine_ip, port=zk_port, timeout=15, + password=0, + force_udp=False, ommit_ping=False) + except NameError: + raise UserError( + _("Pyzk module not Found. Please install it" + "with 'pip3 install pyzk'.")) + conn = self.device_connect(zk) + if conn: + user_tz = self.env.context.get( + 'tz') or self.env.user.tz or 'UTC' + user_timezone_time = pytz.utc.localize(fields.Datetime.now()) + user_timezone_time = user_timezone_time.astimezone( + pytz.timezone(user_tz)) + conn.set_time(user_timezone_time) + return { + 'type': 'ir.actions.client', + 'tag': 'display_notification', + 'params': { + 'message': 'Successfully Set the Time', + 'type': 'success', + 'sticky': False + } + } + else: + raise UserError(_( + "Please Check the Connection")) + def action_clear_attendance(self): """Methode to clear record from the zk.machine.attendance model and @@ -129,6 +164,7 @@ class BiometricDeviceDetails(models.Model): _("Pyzk module not Found. Please install it" "with 'pip3 install pyzk'.")) conn = self.device_connect(zk) + self.action_set_timezone() if conn: conn.disable_device() # Device Cannot be used during this time. user = conn.get_users() diff --git a/hr_zk_attendance/models/daily_attendance.py b/hr_zk_attendance/models/daily_attendance.py index 1f114f931..550303310 100644 --- a/hr_zk_attendance/models/daily_attendance.py +++ b/hr_zk_attendance/models/daily_attendance.py @@ -3,7 +3,7 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Copyright (C) 2024-TODAY Cybrosys Technologies(). # Author: Ammu Raj (odoo@cybrosys.com) # # You can modify it under the terms of the GNU AFFERO diff --git a/hr_zk_attendance/models/hr_employee.py b/hr_zk_attendance/models/hr_employee.py index 08bd4a4d1..128a12b8e 100644 --- a/hr_zk_attendance/models/hr_employee.py +++ b/hr_zk_attendance/models/hr_employee.py @@ -3,7 +3,7 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Copyright (C) 2024-TODAY Cybrosys Technologies(). # Author: Ammu Raj (odoo@cybrosys.com) # # You can modify it under the terms of the GNU AFFERO diff --git a/hr_zk_attendance/models/zk_machine_attendance.py b/hr_zk_attendance/models/zk_machine_attendance.py index c9d4e0c8c..fbbc1abb2 100644 --- a/hr_zk_attendance/models/zk_machine_attendance.py +++ b/hr_zk_attendance/models/zk_machine_attendance.py @@ -3,7 +3,7 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Copyright (C) 2024-TODAY Cybrosys Technologies(). # Author: Ammu Raj (odoo@cybrosys.com) # # You can modify it under the terms of the GNU AFFERO diff --git a/hr_zk_attendance/static/description/assets/screenshots/img7.png b/hr_zk_attendance/static/description/assets/screenshots/img7.png new file mode 100644 index 000000000..10d81882d Binary files /dev/null and b/hr_zk_attendance/static/description/assets/screenshots/img7.png differ diff --git a/hr_zk_attendance/static/description/index.html b/hr_zk_attendance/static/description/index.html index 836b84ba7..2c51d5589 100644 --- a/hr_zk_attendance/static/description/index.html +++ b/hr_zk_attendance/static/description/index.html @@ -158,10 +158,8 @@

HR - Attendance.

-

Automates HR - Attendance. + font-size: 1.2rem; margin-bottom: 2px;">Restart and set Time of Device.

+

We can set the timezone of the device and also restart the device.

@@ -180,10 +178,12 @@

Supporting Models

-

This module support with the following machines :
+

This module + support with the following machines :
* uFace202 (ZKteco)
* iFace990 (ZKteco)
- -Clients have reported that the module works well with the following machine :
+ -Clients have reported that the module works + well with the following machine :
* K40 Pro (ZKteco)
* SFace900 (ZKteco)
* FR1500 (ZKteco)
@@ -315,6 +315,23 @@ +

+
+
+ +
+
+

+ Here you can set the Time zone for Device . +

+
+
+
+
+ +
Can choose - Employee from Work Order itself. + width="16px">Can Download + Attendance
  • Using Project - and Tasks makes it easier. + width="16px">Clear Attendance
  • Timesheet for - Manufacturing. -
      -
    • A Project will be created in the name of - Manufacturing Order , - and Task will be created in the name of - Work Order. The Time - tracking of the Work Order will be added - as Timesheet. -
    • -
    + width="16px">Can Restart + Device from odoo + +
  • +
  • + Can set timezone + of Device. +
  • @@ -402,15 +428,31 @@ style="font-weight: 500;background-color: #fff; border-radius: 4px; padding: 1rem; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);">
    Version - 16.0.1.0.0|Released on:16th November 2023 +
    +

    + + Initial Commit for Biometric Device + Integration.

    +
    + +
    +
    +
    Version + 17.0.1.0.0|Released on:25th May 2023 + style="color: #714B67;font-weight: 600;">Released on:31st July 2024

    - Initial Commit for Manufacturing (MRP) - Timesheet.

    + Added a feature to set the time in Biometric + Device Integration.

    @@ -527,7 +569,7 @@ height="auto">

    - UPCITEMDB Integration

    + UPCITEMDB Integration

    diff --git a/hr_zk_attendance/views/biometric_device_details_views.xml b/hr_zk_attendance/views/biometric_device_details_views.xml index 5bd8a900c..4054deba6 100644 --- a/hr_zk_attendance/views/biometric_device_details_views.xml +++ b/hr_zk_attendance/views/biometric_device_details_views.xml @@ -19,6 +19,8 @@
    +