diff --git a/attendance_iot/models/attendance_iot.py b/attendance_iot/models/attendance_iot.py index 2c5e00c35..1c6dba785 100644 --- a/attendance_iot/models/attendance_iot.py +++ b/attendance_iot/models/attendance_iot.py @@ -82,26 +82,30 @@ class AttendanceIot(models.Model): # 发送开门信号 def action_send_open_door_sigle(self): for record in self: + msg = { + 'cmd': 'setDoor', + 'value': 'on' + } + msg.pop('face_template', None) self.env['iot.message'].create([{ 'name': '开门', 'topic': f'iot/device/{record.name}', 'device_sn': record.name, - 'message_data': json.dumps({ - 'cmd': 'setDoor', - 'value': 'on' - }, ensure_ascii=False) + 'message_data': json.dumps(msg, ensure_ascii=False) }]) def action_send_close_door_sigle(self): for record in self: + msg = { + 'cmd': 'setDoor', + 'value': 'off' + } + msg.pop('face_template', None) self.env['iot.message'].create([{ 'name': '开门', 'topic': f'iot/device/{record.name}', 'device_sn': record.name, - 'message_data': json.dumps({ - 'cmd': 'setDoor', - 'value': 'off' - }, ensure_ascii=False) + 'message_data': json.dumps(msg, ensure_ascii=False) }]) def action_view_logs(self): @@ -110,10 +114,9 @@ class AttendanceIot(models.Model): return { 'name': '考勤机日志', 'type': 'ir.actions.act_window', - 'res_model': 'attendance.iot.log', + 'res_model': 'iot.message', 'view_mode': 'tree,form', - 'domain': [('attendance_iot_id', '=', self.id)], - 'context': {'default_attendance_iot_id': self.id}, + 'domain': [('device_sn', '=', self.name)], } diff --git a/attendance_iot/views/attendance_iot_views.xml b/attendance_iot/views/attendance_iot_views.xml index e844132a6..544f690aa 100644 --- a/attendance_iot/views/attendance_iot_views.xml +++ b/attendance_iot/views/attendance_iot_views.xml @@ -13,9 +13,9 @@ - + - + + + + + + + + +
+
+
+
+
+ : +
+
+
+
+
+ + +
+
+
+
+
+ + + \ No newline at end of file diff --git a/yuthon_report/static/src/components/yuthon_report/text_summary_report.js b/yuthon_report/static/src/components/yuthon_report/text_summary_report.js new file mode 100644 index 000000000..2d842376d --- /dev/null +++ b/yuthon_report/static/src/components/yuthon_report/text_summary_report.js @@ -0,0 +1,52 @@ +/** @odoo-module **/ + +import { registry } from "@web/core/registry"; +import { Component, onMounted, useState } from "@odoo/owl"; +import { useService } from "@web/core/utils/hooks"; +import { standardActionServiceProps } from "@web/webclient/actions/action_service"; + +class TextSummaryReport extends Component { + setup() { + this.serviceOrm = useService("orm"); + + this.state = useState({ + reportData: null, + dateStart: "", + loading: false, + }); + + this.config = this.props.action.context.report_config || {}; + + onMounted(() => { + // 页面加载时自动执行搜索 + this.onSearch(); + }); + } + + async onSearch() { + this.state.loading = true; + + const params = { + date_start: this.state.dateStart, + }; + + try { + const result = await this.serviceOrm.call( + this.config.model || 'text.summary.report', + this.config.method || 'get_text_summary_report', + [params] + ); + this.state.reportData = result; + } catch (error) { + console.error('报表查询失败:', error); + this.state.reportData = null; + } finally { + this.state.loading = false; + } + } +} + +TextSummaryReport.props = { ...standardActionServiceProps }; +TextSummaryReport.template = "text_summary_report.TextSummaryReport"; + +registry.category("actions").add("text_summary_report_client", TextSummaryReport); \ No newline at end of file diff --git a/yuthon_report/static/src/components/yuthon_report/text_summary_report.xml b/yuthon_report/static/src/components/yuthon_report/text_summary_report.xml new file mode 100644 index 000000000..af753c0a0 --- /dev/null +++ b/yuthon_report/static/src/components/yuthon_report/text_summary_report.xml @@ -0,0 +1,90 @@ + + + + +
+ +
+
+
+
+ + +
+
+ +
+
+
+
+ + +
+
+
+
+ 统计时间: + +
+
+ 统计片区: + +
+
+ 所属公司: + +
+
+ 创建时间: + +
+
+
+
+ + +
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+
+
+
+
+ + +
+
+ +

加载中...

+
+
+ + +
+
+ +

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

+
+
+
+
+
\ No newline at end of file diff --git a/yuthon_report/static/src/components/yuthon_report/yuthon_report.scss b/yuthon_report/static/src/components/yuthon_report/yuthon_report.scss index 21619d483..2a4c26ac5 100644 --- a/yuthon_report/static/src/components/yuthon_report/yuthon_report.scss +++ b/yuthon_report/static/src/components/yuthon_report/yuthon_report.scss @@ -81,3 +81,8 @@ justify-content: flex-start; text-align: left; } + + /* 挂账状态行金黄色背景 */ + .ag-row-registered { + background-color: #fffbeb !important; + } diff --git a/yuthon_report/views/bank_statements_report.xml b/yuthon_report/views/bank_statements_report.xml new file mode 100644 index 000000000..54d4bd820 --- /dev/null +++ b/yuthon_report/views/bank_statements_report.xml @@ -0,0 +1,30 @@ + + + + + 未对挂账报表 + simple_bank_report_client + + { + "sideBar": true, + "report_config": { + "model": "bank.statements.report", + "method": "get_bank_statements_report", + "columns": [ + {"headerName": "序号", "field": "序号", "width": 45, "flex": 0, "pinned": "left"}, + {"headerName": "交易时间", "field": "交易时间", "flex": 1.5}, + {"headerName": "交易金额", "field": "交易金额", "flex": 1, "type": "number"}, + {"headerName": "已对账", "field": "已对账", "flex": 1, "type": "number"}, + {"headerName": "未对", "field": "未对", "flex": 1, "type": "number"}, + {"headerName": "备注", "field": "备注", "flex": 2}, + {"headerName": "摘要", "field": "摘要", "flex": 2}, + {"headerName": "对方户名", "field": "对方户名", "flex": 1.5}, + {"headerName": "账号单位", "field": "账号单位", "flex": 1.2}, + {"headerName": "状态", "field": "状态", "flex": 1} + ] + } + } + + + + \ No newline at end of file diff --git a/yuthon_report/views/menu.xml b/yuthon_report/views/menu.xml index 3b272620e..2b6373656 100644 --- a/yuthon_report/views/menu.xml +++ b/yuthon_report/views/menu.xml @@ -63,8 +63,13 @@ name="累计欠收" parent="yuthon_property_income_menu" action="action_cum_arrears_report"/> - + diff --git a/yuthon_report/views/receivable_report_views.xml b/yuthon_report/views/receivable_report_views.xml index eba60276d..092fa09a0 100644 --- a/yuthon_report/views/receivable_report_views.xml +++ b/yuthon_report/views/receivable_report_views.xml @@ -2,7 +2,7 @@ - 应收账单报表 + 当期应收 receivable_report_client { @@ -37,7 +37,7 @@ + + + + + 文字汇总报表 + text_summary_report_client + + { + "report_config": { + "model": "text.summary.report", + "method": "get_text_summary_report" + } + } + + + + + + + \ No newline at end of file diff --git a/yuthon_trade/views/parking_fee_approval_views.xml b/yuthon_trade/views/parking_fee_approval_views.xml index 786a7cc66..48a98d4b1 100644 --- a/yuthon_trade/views/parking_fee_approval_views.xml +++ b/yuthon_trade/views/parking_fee_approval_views.xml @@ -16,12 +16,6 @@ - - - diff --git a/yuthon_trade/views/trade_project_approval_views.xml b/yuthon_trade/views/trade_project_approval_views.xml index be80bf55d..87f84f2a2 100644 --- a/yuthon_trade/views/trade_project_approval_views.xml +++ b/yuthon_trade/views/trade_project_approval_views.xml @@ -18,12 +18,6 @@ - - - diff --git a/yuthon_trade/views/trade_reward_approval_views.xml b/yuthon_trade/views/trade_reward_approval_views.xml index 139fff2f6..27bcf659b 100644 --- a/yuthon_trade/views/trade_reward_approval_views.xml +++ b/yuthon_trade/views/trade_reward_approval_views.xml @@ -16,12 +16,6 @@ - - - diff --git a/yuthon_trade/views/yuthon_business_approval_viwes.xml b/yuthon_trade/views/yuthon_business_approval_viwes.xml index 39ef6d797..b63ec3ca0 100644 --- a/yuthon_trade/views/yuthon_business_approval_viwes.xml +++ b/yuthon_trade/views/yuthon_business_approval_viwes.xml @@ -21,12 +21,6 @@ class="btn-primary" invisible="not work_end"/> - - - @@ -68,8 +62,8 @@ - - + + diff --git a/yuthon_trade/views/yuthon_care_condolences_views.xml b/yuthon_trade/views/yuthon_care_condolences_views.xml index c6ae77be6..8e7e8cfe4 100644 --- a/yuthon_trade/views/yuthon_care_condolences_views.xml +++ b/yuthon_trade/views/yuthon_care_condolences_views.xml @@ -17,12 +17,6 @@ - - - diff --git a/yuthon_trade/views/yuthon_contract_addition_views.xml b/yuthon_trade/views/yuthon_contract_addition_views.xml index e007ebc95..fed96464b 100644 --- a/yuthon_trade/views/yuthon_contract_addition_views.xml +++ b/yuthon_trade/views/yuthon_contract_addition_views.xml @@ -15,12 +15,6 @@ - - - diff --git a/yuthon_trade/views/yuthon_message_approval_views.xml b/yuthon_trade/views/yuthon_message_approval_views.xml index 7842e167f..18412f27b 100644 --- a/yuthon_trade/views/yuthon_message_approval_views.xml +++ b/yuthon_trade/views/yuthon_message_approval_views.xml @@ -17,12 +17,6 @@ - - - diff --git a/yuthon_trade/views/yuthon_mutual_approval_views.xml b/yuthon_trade/views/yuthon_mutual_approval_views.xml index ed4ef1186..5af5f7a25 100644 --- a/yuthon_trade/views/yuthon_mutual_approval_views.xml +++ b/yuthon_trade/views/yuthon_mutual_approval_views.xml @@ -18,12 +18,6 @@ - - - diff --git a/yuthon_trade/views/yuthon_seals_approval_views.xml b/yuthon_trade/views/yuthon_seals_approval_views.xml index 7437004fa..13f924012 100644 --- a/yuthon_trade/views/yuthon_seals_approval_views.xml +++ b/yuthon_trade/views/yuthon_seals_approval_views.xml @@ -20,12 +20,6 @@ - - - diff --git a/yuthon_trade/views/yuthon_social_transfer.xml b/yuthon_trade/views/yuthon_social_transfer.xml index d6b0fcfe1..ef591ab44 100644 --- a/yuthon_trade/views/yuthon_social_transfer.xml +++ b/yuthon_trade/views/yuthon_social_transfer.xml @@ -15,12 +15,6 @@ - - - diff --git a/yuthon_trade/views/yuthon_task_approval_views.xml b/yuthon_trade/views/yuthon_task_approval_views.xml index 287e28bd1..edba23048 100644 --- a/yuthon_trade/views/yuthon_task_approval_views.xml +++ b/yuthon_trade/views/yuthon_task_approval_views.xml @@ -17,12 +17,6 @@ - - - diff --git a/yuthon_trade/views/yuthon_trade_premium.xml b/yuthon_trade/views/yuthon_trade_premium.xml index 35ee67cea..edfaf9514 100644 --- a/yuthon_trade/views/yuthon_trade_premium.xml +++ b/yuthon_trade/views/yuthon_trade_premium.xml @@ -16,12 +16,6 @@ - - - diff --git a/yuthon_trade/views/yuthon_work_condolences_views.xml b/yuthon_trade/views/yuthon_work_condolences_views.xml index 87d52559f..59806a6e0 100644 --- a/yuthon_trade/views/yuthon_work_condolences_views.xml +++ b/yuthon_trade/views/yuthon_work_condolences_views.xml @@ -17,12 +17,6 @@ - - - diff --git a/yuthon_will_task/data/will_task_time_data.xml b/yuthon_will_task/data/will_task_time_data.xml index bc34e541b..5a22366d2 100644 --- a/yuthon_will_task/data/will_task_time_data.xml +++ b/yuthon_will_task/data/will_task_time_data.xml @@ -14,5 +14,18 @@ -1 + + 定时任务:日程待办自动转为已办 + + code + model.add_done() + + + 1 + days + + -1 + + diff --git a/yuthon_will_task/models/yuthon_will_task.py b/yuthon_will_task/models/yuthon_will_task.py index 6b7753dee..e76915821 100644 --- a/yuthon_will_task/models/yuthon_will_task.py +++ b/yuthon_will_task/models/yuthon_will_task.py @@ -271,6 +271,16 @@ class YuthonWillTask(models.Model): else: return timedelta.max + def add_done(self): + today = datetime.date.today() + records = self.search([ + ('task_state', '=', 'will'), + ('end_date', '<', today), + ('end_date', '!=', False), + ]) + if records: + records.write({'task_state': 'done'}) + def add_comment(self): """日程定时任务提醒""" _logger.info('-----------日程任务验证--------') @@ -409,6 +419,8 @@ class YuthonWillTask(models.Model): task_vals['yuthon_will_task_id'] = self.id self.env['yuthon.dates.task'].create(task_vals) + + def schedule_reminders(self): return { 'type': 'ir.actions.act_window', diff --git a/yuthon_work_brand/views/hr_menus.xml b/yuthon_work_brand/views/hr_menus.xml index 3d03ca568..b393a1bb7 100644 --- a/yuthon_work_brand/views/hr_menus.xml +++ b/yuthon_work_brand/views/hr_menus.xml @@ -181,11 +181,6 @@ parent="hr_attendance_root_board_menu" action="yuthon_hr_attendance.action_overtime_approval_report" sequence="15"/> -