diff --git a/attendance_iot/__manifest__.py b/attendance_iot/__manifest__.py
index dad4d55fd..217ab66fe 100644
--- a/attendance_iot/__manifest__.py
+++ b/attendance_iot/__manifest__.py
@@ -18,6 +18,7 @@
'views/attendance_iot_user_views.xml',
'views/attendance_iot_manager_views.xml',
'views/attendance_iot_views.xml',
+ 'views/attendance_iot_log_views.xml',
# 'views/inherit_hr_employee_views.xml',
'wizard/attendance_iot_manager_wizard_views.xml',
'views/iot_message.xml'
diff --git a/attendance_iot/models/__init__.py b/attendance_iot/models/__init__.py
index d8f3cb71c..4b7e9166a 100644
--- a/attendance_iot/models/__init__.py
+++ b/attendance_iot/models/__init__.py
@@ -4,3 +4,4 @@ from . import attendance_iot
from . import attendance_iot_datas
from . import attendance_iot_manager
from . import iot_message
+from . import attendance_iot_log
diff --git a/attendance_iot/models/attendance_iot.py b/attendance_iot/models/attendance_iot.py
index a5b2c4a74..2c5e00c35 100644
--- a/attendance_iot/models/attendance_iot.py
+++ b/attendance_iot/models/attendance_iot.py
@@ -20,6 +20,7 @@ class AttendanceIot(models.Model):
company_id = fields.Many2one('res.company', string="公司")
remake = fields.Text(string='备注')
employee_ids = fields.Many2many('hr.employee', string="员工")
+ is_connected = fields.Boolean(string="连接状态", default=False)
def action_init_device(self):
'''
@@ -102,3 +103,17 @@ class AttendanceIot(models.Model):
'value': 'off'
}, ensure_ascii=False)
}])
+
+ def action_view_logs(self):
+ """查看该设备的日志"""
+ self.ensure_one()
+ return {
+ 'name': '考勤机日志',
+ 'type': 'ir.actions.act_window',
+ 'res_model': 'attendance.iot.log',
+ 'view_mode': 'tree,form',
+ 'domain': [('attendance_iot_id', '=', self.id)],
+ 'context': {'default_attendance_iot_id': self.id},
+ }
+
+
diff --git a/attendance_iot/models/attendance_iot_log.py b/attendance_iot/models/attendance_iot_log.py
new file mode 100644
index 000000000..88ac63640
--- /dev/null
+++ b/attendance_iot/models/attendance_iot_log.py
@@ -0,0 +1,10 @@
+from odoo import api, fields, models
+
+
+class AttendanceIotLog(models.Model):
+ _name = 'attendance.iot.log'
+ _description = '考勤机日志'
+ _order = 'create_date desc'
+
+ attendance_iot_id = fields.Many2one('attendance.iot', string="考勤机设备", required=True, ondelete='cascade')
+ content = fields.Text(string="内容")
diff --git a/attendance_iot/security/ir.model.access.csv b/attendance_iot/security/ir.model.access.csv
index 1bf0c0b7d..d7ad21eda 100644
--- a/attendance_iot/security/ir.model.access.csv
+++ b/attendance_iot/security/ir.model.access.csv
@@ -5,4 +5,5 @@ access_attendance_iot_manager_wizard,attendance.iot.manager.wizard,model_attenda
access_attendance_iot_datas,attendance.iot.datas,model_attendance_iot_datas,base.group_user,1,1,1,1
access_attendance_iot_user,attendance.iot.user,model_attendance_iot_user,base.group_user,1,1,1,1
access_iot_message,iot.message.user,model_iot_message,base.group_user,1,1,1,1
-access_attendance_iot_import_user_wizard,access.attendance.iot.import.user.wizard,model_attendance_iot_import_user_wizard,base.group_user,1,1,1,1
\ No newline at end of file
+access_attendance_iot_import_user_wizard,access.attendance.iot.import.user.wizard,model_attendance_iot_import_user_wizard,base.group_user,1,1,1,1
+access_attendance_iot_log,attendance.iot.log,model_attendance_iot_log,base.group_user,1,1,1,1
\ No newline at end of file
diff --git a/attendance_iot/views/attendance_iot_log_views.xml b/attendance_iot/views/attendance_iot_log_views.xml
new file mode 100644
index 000000000..4304efb73
--- /dev/null
+++ b/attendance_iot/views/attendance_iot_log_views.xml
@@ -0,0 +1,39 @@
+
+
+
+
+ attendance.iot.log.tree
+ attendance.iot.log
+
+
+
+
+
+
+
+
+
+
+
+ attendance.iot.log.form
+ attendance.iot.log
+
+
+
+
+
+
+
+ 考勤机日志
+ attendance.iot.log
+ tree,form
+
+
diff --git a/attendance_iot/views/attendance_iot_views.xml b/attendance_iot/views/attendance_iot_views.xml
index 3d1ee80c1..e844132a6 100644
--- a/attendance_iot/views/attendance_iot_views.xml
+++ b/attendance_iot/views/attendance_iot_views.xml
@@ -16,7 +16,9 @@
+
+
diff --git a/yuthon_work_brand/views/hr_menus.xml b/yuthon_work_brand/views/hr_menus.xml
index 31c4daa07..1f2d6bc06 100644
--- a/yuthon_work_brand/views/hr_menus.xml
+++ b/yuthon_work_brand/views/hr_menus.xml
@@ -228,6 +228,12 @@
action="attendance_iot.attendance_iot_action"
sequence="80"/>
+
+