This commit is contained in:
李鹏宇
2026-04-23 11:36:17 +08:00
2 changed files with 16 additions and 15 deletions
@@ -513,7 +513,7 @@ class SoongWorkflowCommentWizard(models.TransientModel):
"node_btn_name": "0",
"node_btn_id": self.node_btn_id.id,
"approval_state": "2", # 已完成
"lase_click_date": fields.Datetime.now() + timedelta(hours=8),
"lase_click_date": fields.Datetime.now(),
"comment": self.comment,
})
else:
@@ -521,7 +521,7 @@ class SoongWorkflowCommentWizard(models.TransientModel):
"comment": self.comment,
"approval_state": "2", # 已完成
'document_ids': [(6, 0, self.document_ids.ids)],
"lase_click_date": fields.Datetime.now() + timedelta(hours=8)
"lase_click_date": fields.Datetime.now()
})
if current_node_log.node_btn_name == '3':
other_node_logs = self.sudo().env["soong.workflow.log"].search(
@@ -318,6 +318,20 @@ class YuthonVacationReports(models.Model):
self_meal = rec.meal_fee_ids.filtered(lambda o: not o.workflow_record_id and o.text == '上月额度继承')
self_meal.update_lines = rec.remain_missed_meals
add_overtime_lines = rec.overtime_ids.filtered(
lambda o: o.text != '上月额度继承' and o.update_type == 'add' and o.is_void != True)
# 计算补休新增总天数
workday_overtime_add = sum((line.workday or 0) for line in add_overtime_lines) / 8
holidays_overtime_add = sum((line.public_holidays or 0) for line in add_overtime_lines) / 8
rec.this_year1 += workday_overtime_add + holidays_overtime_add
rec.year_workday += workday_overtime_add
rec.year_holiday += holidays_overtime_add
# 计算年假新增总天数
add_leave_lines = rec.leave_ids.filtered(
lambda o: o.text != '上月额度继承' and o.update_type == 'add' and o.is_void != True)
dynamic_remainder_year = sum((line.update_lines or 0) for line in add_leave_lines) / 8
rec.dynamic_remainder_year += dynamic_remainder_year
valid_leave_lines = rec.leave_ids.filtered(
lambda l: l.workflow_record_id and l.update_type == 'reduce' and l.is_void != True
)
@@ -366,19 +380,6 @@ class YuthonVacationReports(models.Model):
rec.used_this_year1 += deduct_from_current1 # 累加到本年已休
remaining_overtime_deduct -= deduct_from_current1
add_overtime_lines = rec.overtime_ids.filtered(lambda o: o.text != '上月额度继承' and o.update_type == 'add' and o.is_void != True)
# 计算补休新增总天数
workday_overtime_add = sum((line.workday or 0) for line in add_overtime_lines) / 8
holidays_overtime_add = sum((line.public_holidays or 0) for line in add_overtime_lines) / 8
rec.this_year1 += workday_overtime_add + holidays_overtime_add
rec.year_workday += workday_overtime_add
rec.year_holiday += holidays_overtime_add
# 计算年假新增总天数
add_leave_lines = rec.leave_ids.filtered(
lambda o: o.text != '上月额度继承' and o.update_type == 'add' and o.is_void != True)
dynamic_remainder_year = sum((line.update_lines or 0) for line in add_leave_lines) / 8
rec.dynamic_remainder_year += dynamic_remainder_year
rec._compute_leave()
rec._compute_meal_fee()
rec._compute_working_overtime()