From c66f3be0a0e1600606249b03433e749f7edff145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Sun, 8 Jun 2025 10:04:06 +0800 Subject: [PATCH] 1 --- preview_easy/static/src/js/preview_many2one.js | 4 +++- preview_easy/static/src/js/qweb.js | 4 +++- .../static/src/views/form/form_controller.js | 5 +++-- yuthon_will_task/models/inherit_room_booking.py | 2 +- yuthon_will_task/models/yuthon_will_task.py | 5 +++-- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/preview_easy/static/src/js/preview_many2one.js b/preview_easy/static/src/js/preview_many2one.js index daedd2c7f..4c95f317f 100644 --- a/preview_easy/static/src/js/preview_many2one.js +++ b/preview_easy/static/src/js/preview_many2one.js @@ -99,7 +99,9 @@ export class PreviewMany2OneField extends Many2OneField { } getExtension(file) { - return file.name.replace(/^.*\./, ""); + if (file.name){ + return file.name.replace(/^.*\./, ""); + } } async onExternalBtnClick() { diff --git a/preview_easy/static/src/js/qweb.js b/preview_easy/static/src/js/qweb.js index cfee1c391..878bca4a0 100644 --- a/preview_easy/static/src/js/qweb.js +++ b/preview_easy/static/src/js/qweb.js @@ -115,7 +115,9 @@ export class Many2ManyBinaryField extends Many2ManyTagsField { } getExtension(file) { - return file.name.replace(/^.*\./, ""); + if (file.name){ + return file.name.replace(/^.*\./, ""); + } } async onFileUploaded(files) { diff --git a/sh_backmate_theme_adv_enterprise/static/src/views/form/form_controller.js b/sh_backmate_theme_adv_enterprise/static/src/views/form/form_controller.js index 4a4761863..3aefc8303 100644 --- a/sh_backmate_theme_adv_enterprise/static/src/views/form/form_controller.js +++ b/sh_backmate_theme_adv_enterprise/static/src/views/form/form_controller.js @@ -65,9 +65,10 @@ patch(FormController.prototype, { // if (this.isAdmin) { await this.model.root.switchMode("readonly"); // } - } else { - this.model.actionService.doAction({ type: 'ir.actions.act_window_close' }); } + // else { + // this.model.actionService.doAction({ type: 'ir.actions.act_window_close' }); + // } }, // async beforeLeave() { diff --git a/yuthon_will_task/models/inherit_room_booking.py b/yuthon_will_task/models/inherit_room_booking.py index 379edb8cc..7e9128b74 100644 --- a/yuthon_will_task/models/inherit_room_booking.py +++ b/yuthon_will_task/models/inherit_room_booking.py @@ -19,7 +19,7 @@ class InheritRoomBooking(models.Model): 'users_ids': [(6, 0, new_record.room_users_ids.ids)], 'employee_ids': [(6, 0, employee_list)], 'task_time_ids': [(6, 0, task_time_ids.ids)], - 'start_time': new_record.start_datetime, + # 'start_time': new_record.start_datetime, 'task_state':'will', 'end_time': new_record.stop_datetime }) diff --git a/yuthon_will_task/models/yuthon_will_task.py b/yuthon_will_task/models/yuthon_will_task.py index a400e241e..7fa89d769 100644 --- a/yuthon_will_task/models/yuthon_will_task.py +++ b/yuthon_will_task/models/yuthon_will_task.py @@ -155,11 +155,12 @@ class YuthonWillTask(models.Model): menu_id = self.env['ir.ui.menu'].search([('name', '=', '我的日程')]) url = f'https://oa.thtzjt.com/web?oauth_uid={employee_id.wecom_userid}#id={self.id}&cids=2&action={menu_id.action.id}&model=yuthon.will.task&view_type=form&menu_id={menu_id.id}' data_name = "事项名称: " + self.task_content + '\n' - data_start_time = '开始时间:' + str(self.start_time + timedelta(hours=8)) + '\n' + # data_start_time = '开始时间:' + str(self.start_time + timedelta(hours=8)) + '\n' data_user_ids = '参与人: ' + ', '.join(self.employee_ids.mapped('name')) + '\n' data_employee_id = ('司机:' + ', '.join(self.employee_ids2.mapped('name')) + '\n') if self.employee_ids2 else '' data_nota = ('备注:' + self.remarks) if self.remarks else ('') + '\n' - data = data_name + data_start_time + data_user_ids + data_nota + data_employee_id + # data = data_name + data_start_time + data_user_ids + data_nota + data_employee_id + data = data_name + data_user_ids + data_nota + data_employee_id self.sudo().env["wecom.apps"].sync_send_message_textcard(category='task', user_id=employee_id.wecom_userid, title="日程事项提醒", description=data, url=url, btntxt="详细信息")