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_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)) 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 @@ + + +