From b86302cc1bdcdd4f147657ce3f3b42bf5f8dd357 Mon Sep 17 00:00:00 2001 From: zhouzhou <123@qq.com> Date: Wed, 27 Nov 2024 20:58:00 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/hr_attendance_views.xml | 33 +++++++++++++++++++ yuthon_work_brand/views/attendance_menu.xml | 17 +++++++++- 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/yuthon_hr_attendance/views/hr_attendance_views.xml b/yuthon_hr_attendance/views/hr_attendance_views.xml index dc16214f9..8e97c93c9 100644 --- a/yuthon_hr_attendance/views/hr_attendance_views.xml +++ b/yuthon_hr_attendance/views/hr_attendance_views.xml @@ -37,6 +37,39 @@ hr.attendance tree,form + + 天河投资 + hr.attendance + tree,form + + { + "search_default_employee": 1 + } + + [('employee_id.yuthon_company','=','thtz')] + + + 天河粮储 + hr.attendance + tree,form + + { + "search_default_employee": 1 + } + + [('employee_id.yuthon_company', '=', 'thlc')] + + + 天河物管 + hr.attendance + tree,form + + { + "search_default_employee": 1 + } + + [('employee_id.yuthon_company', '=', 'thwg')] + 我的考勤 hr.attendance diff --git a/yuthon_work_brand/views/attendance_menu.xml b/yuthon_work_brand/views/attendance_menu.xml index 256c2a7f2..ed4125df9 100644 --- a/yuthon_work_brand/views/attendance_menu.xml +++ b/yuthon_work_brand/views/attendance_menu.xml @@ -162,8 +162,23 @@ + + + Date: Wed, 27 Nov 2024 21:05:05 +0800 Subject: [PATCH 2/2] pengyuthon wechat --- yuthon_will_task/models/yuthon_will_task.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yuthon_will_task/models/yuthon_will_task.py b/yuthon_will_task/models/yuthon_will_task.py index 5d3ff0c9b..75af21121 100644 --- a/yuthon_will_task/models/yuthon_will_task.py +++ b/yuthon_will_task/models/yuthon_will_task.py @@ -5,7 +5,6 @@ from odoo.exceptions import UserError import logging _logger = logging.getLogger(__name__) -now = datetime.now() + timedelta(hours=8) class YuthonWillTask(models.Model): @@ -23,11 +22,12 @@ class YuthonWillTask(models.Model): employee_ids = fields.Many2many('hr.employee', string='人员', default=lambda self: self.env.user.employee_id) task_time_ids = fields.Many2many('yuthon.task.time', string='提醒') start_time = fields.Datetime(string='开始时间', default=fields.Date.today()) - end_time = fields.Datetime(string='结束时间', default=lambda self: datetime.combine(now.date(), time(11, 0, 0))) + end_time = fields.Datetime(string='结束时间', default=lambda self: datetime.combine(datetime.now().date(), time(11, 0, 0))) def will_task_time(self): tasks = self.env['yuthon.will.task'].search([]) for task in tasks: + now = datetime.now() + timedelta(hours=8) start_time = task.start_time + timedelta(hours=8) _logger.info("定时任务执行中") _logger.info("判断前now:{}---start:{}".format(now, start_time))