diff --git a/yuthon_hr_attendance/models/hr_attendance.py b/yuthon_hr_attendance/models/hr_attendance.py index d893469b5..bc7817302 100644 --- a/yuthon_hr_attendance/models/hr_attendance.py +++ b/yuthon_hr_attendance/models/hr_attendance.py @@ -21,7 +21,7 @@ class HrAttendance(models.Model): is_abnormal = fields.Boolean(string="异常", group_operator='count_true') work_time_type = fields.Selection([('close_day', '休息日'), ('work_day', '工作日')], string="工作时间类型") company_id = fields.Many2one('res.company', string='公司', index=True, default=lambda self: self.env.company) - planning_slot_id = fields.Many2one('planning.slot', string='班次') + planning_slot_id = fields.Many2one('planning.slot', string='班次') # ? 用哪个?? on_card_location = fields.Char(string="上班打卡地点") down_card_location = fields.Char(string="下班打卡地点") out_card_time = fields.Datetime(string="外出打卡时间") @@ -32,7 +32,7 @@ class HrAttendance(models.Model): ('four', '四'), ('five', '五'), ('six', '六'), ('seven', '日')], string='星期', compute='_compute_week', store=True) abnormal = fields.Integer(string="异常计算") - shift_id = fields.Many2one('planning.slot', string="班次", store=True) + shift_id = fields.Many2one('planning.slot', string="班次", store=True) # ? 用哪个?? shift_name = fields.Char(string="班次", related="shift_id.template_id.planning_name") noon_duty = fields.Datetime(string="中值") night_duty = fields.Datetime(string="晚值") diff --git a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py index 8fb4ce412..b3310e0e0 100644 --- a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py +++ b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py @@ -649,7 +649,7 @@ class HrAttendanceDetail(models.Model): for planning_slot_id in planning_slot_ids: # 查询其中的一个排版信息是否生成了打卡记录 attendance_obj = self.env['hr.attendance'].search( - [("userid", "=", user.oauth_uid), ("current_data", "=", current_date), ("shift_id", "=", planning_slot_id.id) + [("userid", "=", user.oauth_uid), ("current_data", "=", current_date), ("planning_slot_id", "=", planning_slot_id.id) ], limit=1) if not attendance_obj: @@ -657,7 +657,7 @@ class HrAttendanceDetail(models.Model): 'employee_id': hr_employee_obj.id, "userid": user.oauth_uid, "current_data": current_date, - "shift_id": planning_slot_id.id, + "planning_slot_id": planning_slot_id.id, "attendance_type": "wx_work" }) if attendance_obj.is_approval: @@ -864,7 +864,8 @@ class HrAttendanceDetail(models.Model): :param data: str类型时间 :return: 转换后的时间 """ - + if data >= 24: + data = 23.99 from_time = "%d:%d" % (int(data), round((data - int(data)) * 60)) from_times = str(current_data) + " " + from_time from_ti = datetime.strptime(from_times, "%Y-%m-%d %H:%M") diff --git a/yuthon_property_approval/models/property_lease_contract.py b/yuthon_property_approval/models/property_lease_contract.py index 68edb78c0..2437ccab3 100644 --- a/yuthon_property_approval/models/property_lease_contract.py +++ b/yuthon_property_approval/models/property_lease_contract.py @@ -198,7 +198,7 @@ class PropertyLeaseContract(models.Model): for segment_year in divided_year_segments: first_index += 1 increments_start = segment_year[1] - if first_years_begin and first_index > first_years_begin: + if first_years_begin and first_index >= first_years_begin: # 进入 递增时间 跳出平稳计费极端 break delta = relativedelta(segment_year[1], segment_year[0]) @@ -353,7 +353,7 @@ class PropertyLeaseContract(models.Model): for segment_year in divided_year_segments: first_index += 1 increments_start = segment_year[1] - if first_years_begin and first_index > first_years_begin: + if first_years_begin and first_index >= first_years_begin: # 进入 递增时间 跳出平稳计费极端 break delta = relativedelta(segment_year[1], segment_year[0])