diff --git a/app_odoo_customize/static/src/js/user_menu.js b/app_odoo_customize/static/src/js/user_menu.js index 0ec5b08b9..a2eb438e5 100644 --- a/app_odoo_customize/static/src/js/user_menu.js +++ b/app_odoo_customize/static/src/js/user_menu.js @@ -23,32 +23,32 @@ patch(UserMenu.prototype, { this.app_lang_list = session.app_lang_list; //todo: 演习 shortCutsItem 中的用法,当前是直接 xml 写了展现 - //修正 bug,在移动端不会关闭本身 - //o_burger_menu position-fixed top-0 bottom-0 start-100 d-flex flex-column flex-nowrap burgerslide burgerslide-enter-active - function preferencesItem(env) { - return { - type: "item", - id: "settings", - description: _t("Preferences"), - callback: async function () { - const actionDescription = await env.services.orm.call("res.users", "action_get"); - actionDescription.res_id = env.services.user.userId; - try { - let m = document.getElementsByClassName("o_burger_menu_close"); - if (m) { - m[0].click(); - } - } catch (e) { - ; - } - env.services.action.doAction(actionDescription); - //修正 bug,在移动端不会关闭本身 - }, - sequence: 50, - }; - } - userMenuRegistry.add("profile", preferencesItem, {'force': true, 'menu': this}); - userMenuRegistry.add("refresh_current", refresh_current, {'force': true}); + // 修正 bug,在移动端不会关闭本身 + // o_burger_menu position-fixed top-0 bottom-0 start-100 d-flex flex-column flex-nowrap burgerslide burgerslide-enter-active + // function preferencesItem(env) { + // return { + // type: "item", + // id: "settings", + // description: _t("Preferences"), + // callback: async function () { + // const actionDescription = await env.services.orm.call("res.users", "action_get"); + // actionDescription.res_id = env.services.user.userId; + // try { + // let m = document.getElementsByClassName("o_burger_menu_close"); + // if (m) { + // m[0].click(); + // } + // } catch (e) { + // ; + // } + // env.services.action.doAction(actionDescription); + // //修正 bug,在移动端不会关闭本身 + // }, + // sequence: 50, + // }; + // } + // userMenuRegistry.add("profile", preferencesItem, {'force': true, 'menu': this}); + // userMenuRegistry.add("refresh_current", refresh_current, {'force': true}); if (session.app_show_lang) { userMenuRegistry.add("separator1", separator1, {'force': true}) 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/controllers/kaoqin_test.py b/attendance_iot/controllers/kaoqin_test.py index 338d4ee29..7fb7a43b8 100644 --- a/attendance_iot/controllers/kaoqin_test.py +++ b/attendance_iot/controllers/kaoqin_test.py @@ -56,7 +56,7 @@ class BusController(Controller): except Exception as e: _logger.info(f'抛出异常,异常原因:{e}') return e - _logger.info(f'考勤机发送过来的数据集合{data}-------我把photo去掉因为太长可') + # _logger.info(f'考勤机发送过来的数据集合{data}-------我把photo去掉因为太长可') user_id = data.get('logs')[0].get('user_id') recog_time = data.get('logs')[0].get('recog_time') if recog_time: 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 @@ + + + + + + + +
+
+
+
+ 统计时间: + +
+
+ 统计片区: + +
+
+ 所属公司: + +
+
+ 创建时间: + +
+
+
+
+ + +
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+
+
+
+
+ + +
+
+ +

加载中...

+
+
+ + +
+
+ +

请点击查询按钮获取报表数据

+
+
+ + + \ No newline at end of file diff --git a/yuthon_report/views/pre_arrears_report.xml b/yuthon_report/views/pre_arrears_report.xml index 9d95ac8da..9405e8149 100644 --- a/yuthon_report/views/pre_arrears_report.xml +++ b/yuthon_report/views/pre_arrears_report.xml @@ -13,11 +13,13 @@ "dateMode": "single", "columns": [ {"headerName": "序号", "field": "序号", "width": 45, "flex": 0, "pinned": "left"}, + {"headerName": "应收开始日期", "field": "应收开始日期", "flex": 1}, + {"headerName": "收款日期", "field": "收款日期", "flex": 1}, + {"headerName": "金额", "field": "金额", "flex": 1, "type": "number"}, {"headerName": "合同编号", "field": "合同编号", "flex": 1.2}, {"headerName": "物业名称", "field": "物业名称", "flex": 2.5}, {"headerName": "承租方名称", "field": "承租方名称", "flex": 1.4}, {"headerName": "收款类型", "field": "收款类型", "flex": 1}, - {"headerName": "金额", "field": "金额", "flex": 1, "type": "number"}, {"headerName": "所属公司", "field": "所属公司", "flex": 1}, {"headerName": "管理员", "field": "管理员", "flex": 1} ] diff --git a/yuthon_trade/models/parking_fee_approval.py b/yuthon_trade/models/parking_fee_approval.py index 3d493b6ca..256a760c7 100644 --- a/yuthon_trade/models/parking_fee_approval.py +++ b/yuthon_trade/models/parking_fee_approval.py @@ -4,7 +4,7 @@ from odoo import models, fields, api, exceptions, _ class ParkingFeeApproval(models.Model): _name = 'parking.fee.approval' - _description = '停车费发放' + _description = '停车票发放' _inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin'] diff --git a/yuthon_will_task/controllers/main.py b/yuthon_will_task/controllers/main.py index eb3cc179a..a120d47c4 100644 --- a/yuthon_will_task/controllers/main.py +++ b/yuthon_will_task/controllers/main.py @@ -7,7 +7,7 @@ from odoo.osv import expression from urllib.parse import quote import logging -logger = logging.getLogger(__name__) +_logger = logging.getLogger(__name__) def get_is_leader_domain(is_leader: bool): @@ -86,12 +86,8 @@ class YuthonWillTask(http.Controller): users_id = int(kwargs.get('users_id')) _filter = kwargs.get('filter') state = kwargs.get('state') - order = 'task_datetime desc' if state == 'done' else 'task_datetime desc' - + order = 'task_datetime desc' if state == 'done' else 'task_datetime asc' domain = [('users_ids', 'in', [users_id])] - logger.info(f"{kwargs}") - logger.info(f"{kwargs}") - logger.info(f"{kwargs}") if _filter == 'leader': domain = [('user_role_ids.name', 'in', ['董事长', '分管领导', '总经理', '部门副经理', '副总经理', '司机'])] # expression.AND([domain, get_is_leader_domain(True)]) @@ -111,26 +107,31 @@ class YuthonWillTask(http.Controller): state_dict = dict(WillTask.fields_get(allfields=['task_state'])['task_state']['selection']) result_list = [] task_ids = request.env['yuthon.will.task'].sudo().search(domain, offset=start, limit=20, order=order) + user_id = request.env['res.users'].sudo().search([('id', '=', users_id)]) + company_id = user_id.company_id for task in task_ids: - weekday_str = ["周一", "周二", "周三", "周四", "周五", "周六", "周日"][task.start_date.weekday()] - result = { - 'id': task.id, - 'name': task.name, - 'employee_id': task.employee_id.name or '', - 'employee_ids': ', '.join(task.employee_ids.mapped('name')) if task.employee_ids else '', - 'employee_num': len(task.employee_ids), - 'start_date': fields.Date.to_string(task.start_date), - 'weekday': weekday_str, - 'request_hour_from': '', - 'request_hour_to': '', - 'state': task.task_state, - 'display_state': state_dict.get(task.task_state), - 'task_type': task.task_type - } - hour_dict = dict(request_hour_selection) - result['request_hour_from'] = hour_dict.get(task.request_hour_from) - result['request_hour_to'] = hour_dict.get(task.request_hour_to) - result_list.append(result) + # _logger.info(f"当前用户{user_id.name}--对应公司{company_id.name}--任务公司{task.company_id.name}") + if company_id.id == task.company_id.id: + weekday_str = ["周一", "周二", "周三", "周四", "周五", "周六", "周日"][task.start_date.weekday()] + result = { + 'id': task.id, + 'name': task.name, + 'employee_id': task.employee_id.name or '', + 'employee_ids': ', '.join(task.employee_ids.mapped('name')) if task.employee_ids else '', + 'employee_num': ','.join(task.employee_ids.mapped('name')) if task.employee_ids else '', + 'start_date': fields.Date.to_string(task.start_date), + 'weekday': weekday_str, + 'address': task.address or '', + 'request_hour_from': '', + 'request_hour_to': '', + 'state': task.task_state, + 'display_state': state_dict.get(task.task_state), + 'task_type': task.task_type + } + hour_dict = dict(request_hour_selection) + result['request_hour_from'] = hour_dict.get(task.request_hour_from) + result['request_hour_to'] = hour_dict.get(task.request_hour_to) + result_list.append(result) return json.dumps({ 'data': result_list, 'code': 200, diff --git a/yuthon_will_task/views/yuthon_will_task_views.xml b/yuthon_will_task/views/yuthon_will_task_views.xml index 10cefb9d2..19513c5d1 100644 --- a/yuthon_will_task/views/yuthon_will_task_views.xml +++ b/yuthon_will_task/views/yuthon_will_task_views.xml @@ -309,8 +309,8 @@ - - - + + - diff --git a/yuthon_work_brand/views/hr_menus.xml b/yuthon_work_brand/views/hr_menus.xml index 31c4daa07..3d03ca568 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"/> + + @@ -302,11 +308,11 @@ parent="attendance_resources_setting_root_board" sequence="8" action="yuthon_hr_attendance.view_overtime_page_action"/> - + + + + + + diff --git a/yuthon_work_brand/views/stock_menus.xml b/yuthon_work_brand/views/stock_menus.xml index b4026ab00..a31346008 100644 --- a/yuthon_work_brand/views/stock_menus.xml +++ b/yuthon_work_brand/views/stock_menus.xml @@ -61,6 +61,7 @@ + \ No newline at end of file