Merge pull request #4819 from expsa/khazraji_hr

fix get attendance biotime
This commit is contained in:
mohammed-alkhazrji 2025-10-06 09:39:55 -08:00 committed by GitHub
commit eada09e00b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 115 additions and 94 deletions

View File

@ -18,72 +18,72 @@ msgstr ""
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_terminal__alias
msgid "Alias"
msgstr ""
msgstr "الاسم المستعار"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_system_attendance__area_alias
msgid "Area"
msgstr ""
msgstr "المنطقة"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_area__area_id
msgid "Area id"
msgstr ""
msgstr "معرف المنطقة"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_terminal__area_name
msgid "Area name"
msgstr ""
msgstr "اسم المنطقة"
#. module: to_attendance_system
#: model:ir.ui.menu,name:to_attendance_system.attendance_systems
msgid "Attendance Systems"
msgstr ""
msgstr "أنظمة الحضور والانصراف"
#. module: to_attendance_system
#: model:ir.model,name:to_attendance_system.model_finger_attendance_wizard
msgid "Attendance Wizard"
msgstr ""
msgstr "معالج الحضور"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_system_attendance__attendance_id
msgid "Attendance id"
msgstr ""
msgstr "معرف الحضور"
#. module: to_attendance_system
#: model:ir.ui.menu,name:to_attendance_system.attendace_system_menu
msgid "Attendance systems"
msgstr ""
msgstr "أنظمة الحضور"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_biotime_api__attendance_ids
msgid "Attendances"
msgstr ""
msgstr "سجلات الحضور"
#. module: to_attendance_system
#: code:addons/to_attendance_system/models/models.py:0
#: model:ir.model.fields.selection,name:to_attendance_system.selection__finger_biotime_api__state__authentic
#, python-format
msgid "Authentic"
msgstr ""
msgstr "مصادق عليه"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_system_attendance__crc
msgid "CRC"
msgstr ""
msgstr "كود التحقق"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_area__code
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_employee_department__code
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_employee_position__code
msgid "Code"
msgstr ""
msgstr "الكود"
#. module: to_attendance_system
#: code:addons/to_attendance_system/models/models.py:0
#, python-format
msgid "Confirmed"
msgstr ""
msgstr "مؤكد"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_area__create_uid
@ -95,7 +95,7 @@ msgstr ""
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_system_attendance__create_uid
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_terminal__create_uid
msgid "Created by"
msgstr ""
msgstr "أنشئ بواسطة"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_area__create_date
@ -107,17 +107,17 @@ msgstr ""
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_system_attendance__create_date
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_terminal__create_date
msgid "Created on"
msgstr ""
msgstr "تاريخ الإنشاء"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_employee_department__department_id
msgid "Department id"
msgstr ""
msgstr "معرف القسم"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_biotime_api__description
msgid "Description"
msgstr ""
msgstr "الوصف"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_area__display_name
@ -129,93 +129,93 @@ msgstr ""
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_system_attendance__display_name
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_terminal__display_name
msgid "Display Name"
msgstr ""
msgstr "الاسم المعروض"
#. module: to_attendance_system
#: model_terms:ir.ui.view,arch_db:to_attendance_system.biotime_action_form
msgid "Download areas"
msgstr ""
msgstr "تنزيل المناطق"
#. module: to_attendance_system
#: model:ir.actions.server,name:to_attendance_system.ir_cron_scheduler_download_system_attendance_ir_actions_server
#: model:ir.cron,cron_name:to_attendance_system.ir_cron_scheduler_download_system_attendance
#: model:ir.cron,name:to_attendance_system.ir_cron_scheduler_download_system_attendance
msgid "Download attendances scheduler"
msgstr ""
msgstr "جدولة تنزيل سجلات الحضور"
#. module: to_attendance_system
#: model_terms:ir.ui.view,arch_db:to_attendance_system.biotime_action_form
msgid "Download attenence"
msgstr ""
msgstr "تنزيل الحضور"
#. module: to_attendance_system
#: model_terms:ir.ui.view,arch_db:to_attendance_system.biotime_action_form
msgid "Download departments"
msgstr ""
msgstr "تنزيل الأقسام"
#. module: to_attendance_system
#: model_terms:ir.ui.view,arch_db:to_attendance_system.biotime_action_form
msgid "Download employees"
msgstr ""
msgstr "تنزيل الموظفين"
#. module: to_attendance_system
#: model_terms:ir.ui.view,arch_db:to_attendance_system.biotime_action_form
msgid "Download postions"
msgstr ""
msgstr "تنزيل الوظائف"
#. module: to_attendance_system
#: model_terms:ir.ui.view,arch_db:to_attendance_system.biotime_action_form
msgid "Download terminals"
msgstr ""
msgstr "تنزيل أجهزة البصمة"
#. module: to_attendance_system
#: code:addons/to_attendance_system/models/models.py:0
#, python-format
msgid "Draft"
msgstr ""
msgstr "مسودة"
#. module: to_attendance_system
#: model:ir.actions.act_window,name:to_attendance_system.biotime_system_employee_position_action
#: model:ir.ui.menu,name:to_attendance_system.attendance_systems_employee_position
msgid "Employee Positions"
msgstr ""
msgstr "وظائف الموظفين"
#. module: to_attendance_system
#: model:ir.actions.act_window,name:to_attendance_system.biotime_system_employee_areas_action
msgid "Employee areas"
msgstr ""
msgstr "مناطق الموظفين"
#. module: to_attendance_system
#: model:ir.actions.act_window,name:to_attendance_system.biotime_system_employee_department_action
msgid "Employee departments"
msgstr ""
msgstr "أقسام الموظفين"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_employee_employee__emp_system_id
msgid "Employee id"
msgstr ""
msgstr "معرف الموظف"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_biotime_api__employee_ids
#: model:ir.ui.menu,name:to_attendance_system.attendance_systems_employee
msgid "Employees"
msgstr ""
msgstr "الموظفون"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_employee_employee__hr_employee
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_system_attendance__hr_comployee_id
msgid "Empolyee Name"
msgstr ""
msgstr "اسم الموظف"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_system_attendance__emp
msgid "Empolyee code"
msgstr ""
msgstr "كود الموظف"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_employee_employee__server_id
msgid "Hr empolyee"
msgstr ""
msgstr "موظف الموارد البشرية"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_area__id
@ -227,29 +227,29 @@ msgstr ""
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_system_attendance__id
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_terminal__id
msgid "ID"
msgstr ""
msgstr "المعرف"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_biotime_api__serverUrl
msgid "IP / Domain Name"
msgstr ""
msgstr "عنوان IP / اسم النطاق"
#. module: to_attendance_system
#: code:addons/to_attendance_system/models/models.py:0
#, python-format
msgid "Invalid port number"
msgstr ""
msgstr "رقم المنفذ غير صحيح"
#. module: to_attendance_system
#: code:addons/to_attendance_system/models/models.py:0
#, python-format
msgid "Invalid server url"
msgstr ""
msgstr "عنوان الخادم غير صحيح"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_system_attendance__is_attendance
msgid "Is attendance"
msgstr ""
msgstr "حضور"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_area____last_update
@ -261,7 +261,7 @@ msgstr ""
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_system_attendance____last_update
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_terminal____last_update
msgid "Last Modified on"
msgstr ""
msgstr "آخر تعديل في"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_area__write_uid
@ -273,7 +273,7 @@ msgstr ""
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_system_attendance__write_uid
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_terminal__write_uid
msgid "Last Updated by"
msgstr ""
msgstr "آخر تحديث بواسطة"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_area__write_date
@ -285,27 +285,27 @@ msgstr ""
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_system_attendance__write_date
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_terminal__write_date
msgid "Last Updated on"
msgstr ""
msgstr "آخر تحديث في"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_terminal__last_activity
msgid "Last activity"
msgstr ""
msgstr "آخر نشاط"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_biotime_api__loaded_employees
msgid "Loaded Employees"
msgstr ""
msgstr "الموظفون المحملون"
#. module: to_attendance_system
#: model_terms:ir.ui.view,arch_db:to_attendance_system.biotime_action_form
msgid "Login"
msgstr ""
msgstr "تسجيل الدخول"
#. module: to_attendance_system
#: model_terms:ir.ui.view,arch_db:to_attendance_system.biotime_action_form
msgid "Logout"
msgstr ""
msgstr "تسجيل الخروج"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_area__name
@ -313,215 +313,215 @@ msgstr ""
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_employee_department__name
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_employee_position__name
msgid "Name"
msgstr ""
msgstr "الاسم"
#. module: to_attendance_system
#: code:addons/to_attendance_system/models/models.py:0
#: model:ir.model.fields.selection,name:to_attendance_system.selection__finger_biotime_api__state__unauthentic
#, python-format
msgid "Not authentic"
msgstr ""
msgstr "غير مصادق عليه"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_biotime_api__password
msgid "Password"
msgstr ""
msgstr "كلمة المرور"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_biotime_api__port
msgid "Port"
msgstr ""
msgstr "المنفذ"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_employee_position__position_id
msgid "Position id"
msgstr ""
msgstr "معرف الوظيفة"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_system_attendance__punch_state
msgid "Punch state"
msgstr ""
msgstr "حالة البصمة"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_system_attendance__punch_time
msgid "Punch time"
msgstr ""
msgstr "وقت البصمة"
#. module: to_attendance_system
#: model_terms:ir.ui.view,arch_db:to_attendance_system.biotime_action_form
msgid "Refresh"
msgstr ""
msgstr "تحديث"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_terminal__sn
msgid "SN"
msgstr ""
msgstr "الرقم التسلسلي"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_biotime_api__state
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_system_attendance__state
msgid "State"
msgstr ""
msgstr "الحالة"
#. module: to_attendance_system
#: model:ir.actions.server,name:to_attendance_system.ir_cron_scheduler_sync_system_attendance_ir_actions_server
#: model:ir.cron,cron_name:to_attendance_system.ir_cron_scheduler_sync_system_attendance
#: model:ir.cron,name:to_attendance_system.ir_cron_scheduler_sync_system_attendance
msgid "Synchronize attendances scheduler"
msgstr ""
msgstr "جدولة مزامنة سجلات الحضور"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_attendance_wizard__system_ids
msgid "System"
msgstr ""
msgstr "النظام"
#. module: to_attendance_system
#: model:ir.ui.menu,name:to_attendance_system.attendance_systems_employee_areas
msgid "System Areas"
msgstr ""
msgstr "مناطق النظام"
#. module: to_attendance_system
#: model:ir.ui.menu,name:to_attendance_system.attendance_systems_employee_attendance
msgid "System Attendance"
msgstr ""
msgstr "حضور النظام"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_employee_employee__department_id
msgid "System Deparment"
msgstr ""
msgstr "قسم النظام"
#. module: to_attendance_system
#: model:ir.ui.menu,name:to_attendance_system.attendance_systems_employee_department
msgid "System Departments"
msgstr ""
msgstr "أقسام النظام"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_employee_employee__name
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_system_attendance__emp_code
msgid "System Employee Name"
msgstr ""
msgstr "اسم موظف النظام"
#. module: to_attendance_system
#: model:ir.actions.act_window,name:to_attendance_system.biotime_system_employee_action
msgid "System Employees"
msgstr ""
msgstr "موظفو النظام"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_employee_employee__position_id
msgid "System Position"
msgstr ""
msgstr "وظيفة النظام"
#. module: to_attendance_system
#: model:ir.actions.act_window,name:to_attendance_system.biotime_system_terminal_action
#: model:ir.ui.menu,name:to_attendance_system.attendance_systems_terminal
msgid "System Terminals"
msgstr ""
msgstr "أجهزة النظام"
#. module: to_attendance_system
#: model:ir.actions.act_window,name:to_attendance_system.biotime_system_attendance_action
msgid "System attendances"
msgstr ""
msgstr "سجلات حضور النظام"
#. module: to_attendance_system
#: model:ir.actions.act_window,name:to_attendance_system.biotime_action
msgid "System connector"
msgstr ""
msgstr "موصل النظام"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_employee_employee__code
msgid "System employee Code"
msgstr ""
msgstr "كود موظف النظام"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_terminal__terminal_id
msgid "Termainl id"
msgstr ""
msgstr "معرف الجهاز"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_system_attendance__terminal_id
msgid "Terminal"
msgstr ""
msgstr "الجهاز"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_terminal__name
msgid "Terminal name"
msgstr ""
msgstr "اسم الجهاز"
#. module: to_attendance_system
#: model_terms:ir.ui.view,arch_db:to_attendance_system.biotime_action_form
msgid "To system attendance"
msgstr ""
msgstr "إلى حضور النظام"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_biotime_api__token
msgid "Token"
msgstr ""
msgstr "الرمز المميز"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_system_attendance__upload_time
msgid "Upload time"
msgstr ""
msgstr "وقت الرفع"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_biotime_api__username
msgid "Username"
msgstr ""
msgstr "اسم المستخدم"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_system_attendance__verify_type
msgid "Verify type"
msgstr ""
msgstr "نوع التحقق"
#. module: to_attendance_system
#: code:addons/to_attendance_system/wizard/attendaces_wizard.py:0
#, python-format
msgid "You must select at least one device to continue!"
msgstr ""
msgstr "يجب اختيار جهاز واحد على الأقل للمتابعة!"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_employee_employee__email
msgid "email"
msgstr ""
msgstr "البريد الإلكتروني"
#. module: to_attendance_system
#: model:ir.model,name:to_attendance_system.model_finger_area
msgid "finger.area"
msgstr ""
msgstr "finger.area"
#. module: to_attendance_system
#: model:ir.model,name:to_attendance_system.model_finger_biotime_api
msgid "finger.biotime_api"
msgstr ""
msgstr "finger.biotime_api"
#. module: to_attendance_system
#: model:ir.model,name:to_attendance_system.model_finger_employee_department
msgid "finger.employee.department"
msgstr ""
msgstr "finger.employee.department"
#. module: to_attendance_system
#: model:ir.model,name:to_attendance_system.model_finger_employee_employee
msgid "finger.employee.employee"
msgstr ""
msgstr "finger.employee.employee"
#. module: to_attendance_system
#: model:ir.model,name:to_attendance_system.model_finger_employee_position
msgid "finger.employee.position"
msgstr ""
msgstr "finger.employee.position"
#. module: to_attendance_system
#: model:ir.model,name:to_attendance_system.model_finger_system_attendance
msgid "finger.system_attendance"
msgstr ""
msgstr "finger.system_attendance"
#. module: to_attendance_system
#: model:ir.model,name:to_attendance_system.model_finger_terminal
msgid "finger.terminal"
msgstr ""
msgstr "finger.terminal"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_terminal__ip_address
msgid "ip address"
msgstr ""
msgstr "عنوان IP"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_area__server_id
@ -530,19 +530,32 @@ msgstr ""
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_system_attendance__server_id
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_terminal__server_id
msgid "server"
msgstr ""
msgstr "الخادم"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_biotime_api__terminals_ids
msgid "terminals"
msgstr ""
msgstr "الأجهزة"
#. module: to_attendance_system
#: model:ir.model.fields.selection,name:to_attendance_system.selection__finger_system_attendance__state__confirmed
msgid "مؤكد"
msgstr ""
msgstr "مؤكد"
#. module: to_attendance_system
#: model:ir.model.fields.selection,name:to_attendance_system.selection__finger_system_attendance__state__draft
msgid "مسوده"
msgstr ""
msgstr "مسودة"
#. module: to_attendance_system
#: model:ir.model.fields,field_description:to_attendance_system.field_finger_biotime_api__start_sync_date
msgid "Start Sync Date"
msgstr "تاريخ بدء المزامنة"
#. module: to_attendance_system
#: code:addons/odoo/STANDARD_MODULES/test/odex25_hr/odex25_hr/to_attendance_system/models/models.py:0
#: code:addons/to_attendance_system/models/models.py:0
#, python-format
msgid "Start Sync Date cannot be in the future. Please select now or a past date."
msgstr "لا يمكن أن يكون تاريخ بدء المزامنة في المستقبل. الرجاء اختيار الوقت الحالي أو تاريخ سابق."

View File

@ -113,7 +113,13 @@ class BiotimeAPI(models.Model):
state = fields.Selection(
[('authentic', _('Authentic')),
('unauthentic', _('Not authentic'))], default="unauthentic")
start_sync_date = fields.Datetime(string="Start Sync Date", default=lambda self: fields.Datetime.now())
@api.constrains('start_sync_date')
def _check_start_sync_date(self):
for record in self:
if record.start_sync_date and record.start_sync_date > fields.Datetime.now():
raise ValidationError(_("Start Sync Date cannot be in the future. Please select now or a past date."))
@api.model
def _calc_urls(self):
serverIP = self.serverUrl + ":" + self.port
@ -367,8 +373,9 @@ class BiotimeAPI(models.Model):
self.refresh()
_, _, _, _, _, _, _, _, _, transctionsUrl = self._calc_urls()
# 10 (Oct month 2025)
start_date = "2025-10-01 00:00:00"
start_date = self.start_sync_date.strftime(
'%Y-%m-%d %H:%M:%S') if self.start_sync_date else "2025-10-01 00:00:00"
url_with_filter = transctionsUrl + "?start_time=" + start_date
res = httpHelper.fetch_empl_transctions({}, self.token, url_with_filter)

View File

@ -34,6 +34,7 @@
<field name="username" required="1"/>
<field name="password" password="True"/>
<field name="description"/>
<field name="start_sync_date"/>
<field name="attendance_ids" readonly="1"/>
<field name="employee_ids" readonly="1"/>
<field name="terminals_ids" readonly="1"/>