Merge branch 'dev' into dev_zhou

This commit is contained in:
zhou
2025-06-08 21:54:11 +08:00
5 changed files with 19 additions and 12 deletions
@@ -99,7 +99,9 @@ export class PreviewMany2OneField extends Many2OneField {
}
getExtension(file) {
return file.name.replace(/^.*\./, "");
if (file.name){
return file.name.replace(/^.*\./, "");
}
}
async onExternalBtnClick() {
+3 -1
View File
@@ -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) {
@@ -3,7 +3,7 @@ import { patch } from "@web/core/utils/patch";
import { session } from "@web/session";
import { FormController } from "@web/views/form/form_controller";
import { Mutex } from "@web/core/utils/concurrency";
import {useService } from "@web/core/utils/hooks";
const originalSetup = FormController.prototype.setup;
const originalEdit = FormController.prototype.edit;
const originalSaveButtonClicked = FormController.prototype.saveButtonClicked;
@@ -17,6 +17,7 @@ patch(FormController.prototype, {
// if (this.isAdmin) {
// this.props.preventEdit = this.env.inDialog ? false : true;
// }
this.actionService =useService("action");
this.props.preventEdit = this.env.inDialog ? false : true;
originalSetup.call(this);
},
@@ -48,9 +49,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 discard() {
@@ -63,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() {
@@ -65,7 +65,6 @@ class AppletAttendance(Controller):
'data': {"Msg": "超出范围,不允许打卡", 'state': 'no', 'state_result': '超出范围'},
'code': '200',
'message': 'OK',
}
return json.dumps(return_data)
else:
@@ -130,8 +129,8 @@ class AppletAttendance(Controller):
"""
使用geopy库判断是否在范围内
"""
point1 = (lat1, lon1)
point2 = (lat2, lon2)
point1 = (float(lat1), float(lon1))
point2 = (float(lat2), float(lon2))
distance = geodesic(point1, point2).kilometers
return distance <= radius_km
+3 -2
View File
@@ -156,11 +156,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="详细信息")