diff --git a/soong_workflow/models/soong_workflow_record.py b/soong_workflow/models/soong_workflow_record.py
index b3c29b161..fa228e304 100644
--- a/soong_workflow/models/soong_workflow_record.py
+++ b/soong_workflow/models/soong_workflow_record.py
@@ -11,7 +11,7 @@ _logger = logging.getLogger(__name__)
class SoongWorkflowRecord(models.Model):
_name = "soong.workflow.record"
_description = "工作流记录"
- _order = 'write_date2'
+ _order = 'write_date2 desc'
_rec_name = 'code'
def get_no_read_count(self):
diff --git a/soong_workflow/wizard/soong_workflow_comment_wizard.py b/soong_workflow/wizard/soong_workflow_comment_wizard.py
index 615361480..ffb81357c 100644
--- a/soong_workflow/wizard/soong_workflow_comment_wizard.py
+++ b/soong_workflow/wizard/soong_workflow_comment_wizard.py
@@ -494,35 +494,54 @@ class SoongWorkflowCommentWizard(models.TransientModel):
if self.node_btn_name == '结束':
current_user = self.env.user
current_datetime = fields.Datetime.now()
- log_records = record_id.log_ids
- if record_id.log_ids2:
- log_records = record_id.log_ids2
- elif record_id.log_ids:
+ is_admin = current_user.has_group('soong_workflow.group_soong_workflow_manager')
+ if is_admin:
+ record_id.log_ids[-1].comment = self.comment
+ record_id.log_ids[-1].approval_state = "3"
+ record_id.log_ids[-1].lase_click_date = fields.Datetime.now()
+ record_id.work_end = True
+ self.env['soong.workflow.record'].search([('code', '=', record_id.code)]).write({'approve_state': 'end',
+ "employee_ids": False,
+ "node_id": False, })
+ else:
log_records = record_id.log_ids
+ if record_id.log_ids2:
+ log_records = record_id.log_ids2
+ elif record_id.log_ids:
+ log_records = record_id.log_ids
- if log_records:
- # 查找当前用户的日志记录并更新
- user_log = log_records.filtered(lambda log: log.done_by == current_user)
- if user_log:
- user_log.write({
- 'comment': self.comment,
- 'approval_state': "3",
- 'lase_click_date': current_datetime
- })
- last_log = log_records[-1] if log_records else None
- if last_log:
- same_name_logs = log_records.filtered(
- lambda log: log.name == last_log.name
- and log.node_btn_name == '4'
- and log.id != last_log.id
- )
+ if log_records:
+ # 查找当前用户的日志记录并更新
+ user_log = log_records.filtered(lambda log: log.done_by == current_user)
+ if user_log:
+ user_log.write({
+ 'comment': self.comment,
+ 'approval_state': "3",
+ 'lase_click_date': current_datetime
+ })
+ last_log = log_records[-1] if log_records else None
+ if last_log:
+ same_name_logs = log_records.filtered(
+ lambda log: log.name == last_log.name
+ and log.node_btn_name == '4'
+ and log.id != last_log.id
+ )
- # 判断是否需要更新工作流状态
- if same_name_logs:
- all_approved = all(log.approval_state == '3' for log in same_name_logs)
- all_approved = all_approved and (last_log.approval_state == '3')
- if all_approved:
- # 所有符合条件的记录都已批准,更新工作流状态
+ # 判断是否需要更新工作流状态
+ if same_name_logs:
+ all_approved = all(log.approval_state == '3' for log in same_name_logs)
+ all_approved = all_approved and (last_log.approval_state == '3')
+ if all_approved:
+ # 所有符合条件的记录都已批准,更新工作流状态
+ self.env['soong.workflow.record'].search([
+ ('code', '=', record_id.code)
+ ]).write({
+ 'approve_state': 'end',
+ 'employee_ids': False,
+ 'node_id': False,
+ })
+ record_id.work_end = True
+ else:
self.env['soong.workflow.record'].search([
('code', '=', record_id.code)
]).write({
@@ -531,15 +550,6 @@ class SoongWorkflowCommentWizard(models.TransientModel):
'node_id': False,
})
record_id.work_end = True
- else:
- self.env['soong.workflow.record'].search([
- ('code', '=', record_id.code)
- ]).write({
- 'approve_state': 'end',
- 'employee_ids': False,
- 'node_id': False,
- })
- record_id.work_end = True
# 给申请人发消息
biz_record = self.env[self.res_model].browse(self.res_id)
diff --git a/yuthon_hr_attendance/models/hr_attendance.py b/yuthon_hr_attendance/models/hr_attendance.py
index 05863070c..4c55ac0e0 100644
--- a/yuthon_hr_attendance/models/hr_attendance.py
+++ b/yuthon_hr_attendance/models/hr_attendance.py
@@ -1035,6 +1035,7 @@ class HrAttendance(models.Model):
record.shift_name = ''
else:
record.shift_name = '行政班次'
+
self._update_vacation_report(record)
return record
diff --git a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py
index 4070ffcd0..fa94c0230 100644
--- a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py
+++ b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py
@@ -252,6 +252,7 @@ class HrAttendanceDetail(models.Model):
attendance.write({
'check_in': check_in_time,
'check_out': check_out_time,
+ 'shift_id': planning_slots.id,
'is_early_card': is_early_card,
'is_late_card': is_late_card,
'is_abnormal': is_abnormal,
@@ -262,6 +263,7 @@ class HrAttendanceDetail(models.Model):
else:
self.env['hr.attendance'].create({
'employee_id': employee.id,
+ 'shift_id': planning_slots.id,
'current_data': current_data,
'check_in': check_in_time,
'check_out': check_out_time,
diff --git a/yuthon_hr_attendance/models/hr_attendance_month.py b/yuthon_hr_attendance/models/hr_attendance_month.py
index 1d3d94312..e771e1cf0 100644
--- a/yuthon_hr_attendance/models/hr_attendance_month.py
+++ b/yuthon_hr_attendance/models/hr_attendance_month.py
@@ -105,7 +105,7 @@ class HrAttendanceMonthDetail(models.Model):
actual_attendance_days = fields.Integer(string="实际出勤天数")
compensatory_leave = fields.Integer(string="调休")
leave_of_absence = fields.Integer(string="事假", digits=(16, 3))
- statutory_leave = fields.Integer(string="加班时(法定假)")
+ statutory_leave = fields.Integer(string="加班时(法定)")
work_overtime = fields.Integer(string="加班")
entry_date = fields.Date(related='employee_id.entry_date', string="入职日期")
expected_date = fields.Date(string="离职日期")
diff --git a/yuthon_hr_attendance/views/overtime_approval.xml b/yuthon_hr_attendance/views/overtime_approval.xml
index 9267cfc75..cdfc65c51 100644
--- a/yuthon_hr_attendance/views/overtime_approval.xml
+++ b/yuthon_hr_attendance/views/overtime_approval.xml
@@ -88,8 +88,9 @@
+
-
+
diff --git a/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml b/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml
index fd417f95a..0deb02c57 100644
--- a/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml
+++ b/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml
@@ -19,6 +19,7 @@
+
@@ -90,7 +91,7 @@
-
+
@@ -418,7 +419,7 @@
- 假期额度日志
+ 考勤确认单台账
yuthon.vacation.reports
tree,form
{'search_default_group_by_employee_id': 1, 'search_default_group_by_vacation_year': True, 'search_default_group_by_vacation_month': True}
diff --git a/yuthon_issue/models/issue_approval.py b/yuthon_issue/models/issue_approval.py
index 2d30cb546..2fa0a276d 100644
--- a/yuthon_issue/models/issue_approval.py
+++ b/yuthon_issue/models/issue_approval.py
@@ -40,20 +40,23 @@ class IssueApproval(models.Model):
def _check_issue_approval_ids(self):
for rec in self:
if rec.issue_approval_ids:
- # 处理 issue_library_id.name(假设为字符串,无需转换)
- issue_names = [issue_library.issue_library_id.name for issue_library in rec.issue_approval_ids]
- # 处理 approval_decision_sequence,确保转换为字符串
+ issue_names = []
+ for issue_library in rec.issue_approval_ids:
+ name_val = issue_library.issue_library_id.name or ""
+ issue_names.append(str(name_val))
+
decision_sequences = []
for issue_library in rec.issue_approval_ids:
- # 假设 approval_decision_sequence 是布尔类型,转换为 '是'/‘否’ 或直接转字符串
- if isinstance(issue_library.approval_decision_sequence, bool):
- decision_sequences.append('是' if issue_library.approval_decision_sequence else '否')
+ seq_val = issue_library.approval_decision_sequence
+ if isinstance(seq_val, bool):
+ decision_sequences.append("是" if seq_val else "否")
else:
- # 其他类型(如整数、浮点数)直接转字符串
- decision_sequences.append(str(issue_library.approval_decision_sequence))
- # 拼接字符串
- rec.issue_display = '\n'.join(issue_names)
- rec.decision_display = '\n'.join(decision_sequences)
+ decision_sequences.append(str(seq_val or ""))
+
+ rec.issue_display = "\n".join(issue_names)
+ rec.decision_display = "\n".join(decision_sequences)
+ else:
+ rec.issue_display = ""
class IssueApprovalLine(models.Model):
_name = 'issue.approval.line'
diff --git a/yuthon_issue/views/issue_approval_views.xml b/yuthon_issue/views/issue_approval_views.xml
index 39821a9f6..d5db01584 100644
--- a/yuthon_issue/views/issue_approval_views.xml
+++ b/yuthon_issue/views/issue_approval_views.xml
@@ -7,8 +7,8 @@
-
-
+
+
@@ -53,8 +53,6 @@
-
-
diff --git a/yuthon_property/models/yuthon_property.py b/yuthon_property/models/yuthon_property.py
index 8d2257e7a..e51340d69 100644
--- a/yuthon_property/models/yuthon_property.py
+++ b/yuthon_property/models/yuthon_property.py
@@ -201,10 +201,8 @@ class YuthonProperty(models.Model):
property_ids = self.env["yuthon.property"].browse(
self._context.get('active_ids', self._context.get('active_id')))
for rec in property_ids:
- if rec.manage_information_ids:
- precinct_id = self.env['yuthon.precinct.message'].search([('employee_id', '=', rec.admin_id.employee_ids.id)])
- rec.manage_information_ids[-1].precinct_id = precinct_id.id
- rec.manage_information_ids[-1].admin_id = rec.manage_information_ids[-1].precinct_id.employee_id.user_id
+ rec._compute_information_fields()
+
def put_declare_approval(self):
property_ids = self.env["yuthon.property"].browse(
diff --git a/yuthon_property/views/yuthon_property_views.xml b/yuthon_property/views/yuthon_property_views.xml
index eed2e4a51..a929010b8 100644
--- a/yuthon_property/views/yuthon_property_views.xml
+++ b/yuthon_property/views/yuthon_property_views.xml
@@ -474,7 +474,7 @@
- 更新片区
+ 更新管理信息
code
diff --git a/yuthon_property_approval/wizard/property_rental_wizard.py b/yuthon_property_approval/wizard/property_rental_wizard.py
index 07a7f928d..767029862 100644
--- a/yuthon_property_approval/wizard/property_rental_wizard.py
+++ b/yuthon_property_approval/wizard/property_rental_wizard.py
@@ -178,8 +178,7 @@ class PropertyRentalWizard(models.Model):
start_year_month = start_date_adj.strftime('%Y-%m')
end_year_month = rent_id.end_data.strftime('%Y-%m')
start_day = start_date_adj.day
- # 通过period_month 来判断是否有免租期,则使用 ,否则月租金使用 期间租金
- rent_amount = rent_id.monthly_amount if period_month else rent_id.period_rent
+ rent_amount = rent_id.monthly_amount
if is_year:
if rent_id.month_number >12:
multiplier = rent_id.month_number - 12
@@ -212,7 +211,8 @@ class PropertyRentalWizard(models.Model):
last_day = (first_day + relativedelta(months=1, days=-1)) # 当月最后一天
records = self.env['property.lease.contract'].search([
('actual_start_time', '<=', last_day),
- ('actual_end_time', '>=', first_day)
+ ('actual_end_time', '>=', first_day),
+ ('contract_code', '=', 'TX2024-A026')
])
for record in records:
date_data = {
diff --git a/yuthon_work_brand/views/hr_menus.xml b/yuthon_work_brand/views/hr_menus.xml
index 12ed113da..9ee30c71d 100644
--- a/yuthon_work_brand/views/hr_menus.xml
+++ b/yuthon_work_brand/views/hr_menus.xml
@@ -160,7 +160,7 @@