diff --git a/soong_workflow/models/soong_workflow_log.py b/soong_workflow/models/soong_workflow_log.py
index 82df3e152..c9fccdc92 100644
--- a/soong_workflow/models/soong_workflow_log.py
+++ b/soong_workflow/models/soong_workflow_log.py
@@ -29,6 +29,18 @@ class SoongWorkflowLog(models.Model):
document_ids = fields.Many2many('ir.attachment', string="附件")
active = fields.Boolean(string="归档", default=True)
+ display_field = fields.Char(string="显示字段", compute="_compute_display_field")
+
+ @api.depends("lase_click_date", "done_by")
+ def _compute_display_field(self):
+ for record in self:
+ user_name = record.done_by.name or ""
+ if record.lase_click_date:
+ lase_click_date = record.lase_click_date.strftime("%Y-%m-%d")
+ else:
+ lase_click_date = ""
+ record.display_field = f"{user_name}-{lase_click_date}"
+
@api.depends("workflow_id", "node_id", "node_btn_id")
def _compute_name(self):
for rec in self:
diff --git a/soong_workflow/templates/soong_workflow_templates.xml b/soong_workflow/templates/soong_workflow_templates.xml
index f480ef097..521bd48d1 100644
--- a/soong_workflow/templates/soong_workflow_templates.xml
+++ b/soong_workflow/templates/soong_workflow_templates.xml
@@ -23,8 +23,9 @@
groups="soong_workflow.group_soong_workflow_manager"/>
-
-
+
+
+
@@ -75,8 +76,9 @@
-
-
+
+
+
diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py
index 685a558cc..a08accc34 100644
--- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py
+++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py
@@ -88,6 +88,54 @@ class YuthonVacationReports(models.Model):
)
records.write({'vacation_state': 'not_sent'})
+ def write(self, vals):
+ result = super(YuthonVacationReports, self).write(vals)
+ if 'vacation_state' in vals and vals['vacation_state'] == 'confirmed':
+ for record in self:
+ if record.leave_ids:
+ record.leave_ids.write({'is_confirm': True})
+ if record.overtime_ids:
+ record.overtime_ids.write({'is_confirm': True})
+ if record.meal_fee_ids:
+ record.meal_fee_ids.write({'is_confirm': True})
+ if record.medical_fee_ids:
+ record.medical_fee_ids.write({'is_confirm': True})
+ if record.other_fee_ids:
+ record.other_fee_ids.write({'is_confirm': True})
+ return result
+
+ def update_is_confirm(self):
+ reports_active_ids = self.env["yuthon.vacation.reports"].browse(
+ self._context.get('active_ids', self._context.get('active_id')))
+ for record in reports_active_ids:
+ if record.vacation_state == 'confirmed':
+ if record.leave_ids:
+ record.leave_ids.write({'is_confirm': True})
+ if record.overtime_ids:
+ record.overtime_ids.write({'is_confirm': True})
+ if record.meal_fee_ids:
+ record.meal_fee_ids.write({'is_confirm': True})
+ if record.medical_fee_ids:
+ record.medical_fee_ids.write({'is_confirm': True})
+ if record.other_fee_ids:
+ record.other_fee_ids.write({'is_confirm': True})
+
+ @api.onchange('vacation_state')
+ def _onchange_vacation_state_confirm(self):
+ """当状态改为已确认时,更新所有明细的is_confirm为True"""
+ if self.vacation_state == 'confirmed':
+ # 批量更新4个明细字段(处理明细为空的边界情况)
+ if self.leave_ids:
+ self.leave_ids.write({'is_confirm': True})
+ if self.overtime_ids:
+ self.overtime_ids.write({'is_confirm': True})
+ if self.meal_fee_ids:
+ self.meal_fee_ids.write({'is_confirm': True})
+ if self.medical_fee_ids:
+ self.medical_fee_ids.write({'is_confirm': True})
+ if self.other_fee_ids:
+ self.other_fee_ids.write({'is_confirm': True})
+
@api.constrains('employee_id', 'vacation_date')
def _check_duplicate_monthly_record(self):
"""检查是否存在同一员工当月的重复记录"""
@@ -740,6 +788,7 @@ class VacationLeaveLine(models.Model):
valid_date = fields.Date(string='有效期至')
adjust_date = fields.Date(string='调整至')
text = fields.Text(string='备注')
+ is_confirm = fields.Boolean(string="是否确认")
def open_record(self):
if self.workflow_record_id:
@@ -751,6 +800,9 @@ class VacationLeaveLine(models.Model):
'view_mode': 'form',
}
+ def action_void(self):
+ self.is_void = True
+
@api.model
def create(self, vals):
return super(VacationLeaveLine, self).create(vals)
@@ -793,6 +845,10 @@ class VacationOverline(models.Model):
adjust_date = fields.Date(string='调整至')
overtime_methods = fields.Selection([('leave', '补休'), ('fee', '加班费结算')], string='加班补偿方式', default='leave')
text = fields.Text(string='备注')
+ is_confirm = fields.Boolean(string="是否确认")
+
+ def action_void(self):
+ self.is_void = True
def open_record(self):
if self.workflow_record_id:
@@ -852,6 +908,10 @@ class VacationMealLine(models.Model):
adjust_date = fields.Date(string='调整至')
is_manual = fields.Boolean(string="手动修改")
text = fields.Text(string='备注')
+ is_confirm = fields.Boolean(string="是否确认")
+
+ def action_void(self):
+ self.is_void = True
def open_record(self):
if self.workflow_record_id:
@@ -904,6 +964,10 @@ class VacationMedicalLine(models.Model):
lines = fields.Float(string='额度')
is_void = fields.Boolean(string='是否作废', default=False)
text = fields.Text(string='备注')
+ is_confirm = fields.Boolean(string="是否确认")
+
+ def action_void(self):
+ self.is_void = True
def open_record(self):
if self.workflow_record_id:
@@ -995,6 +1059,7 @@ class VacationOtherLine(models.Model):
is_void = fields.Boolean(string='是否作废', default=False)
lines = fields.Float(string='天数')
text = fields.Text(string='备注')
+ is_confirm = fields.Boolean(string="是否确认")
def open_record(self):
if self.workflow_record_id:
diff --git a/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml b/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml
index 36e415b82..5997d0be5 100644
--- a/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml
+++ b/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml
@@ -152,7 +152,10 @@
-
+
+
+
+
@@ -175,7 +178,9 @@
-
+
+
+
@@ -193,7 +198,9 @@
-
+
+
+
@@ -210,7 +217,9 @@
-
+
+
+
@@ -227,7 +236,9 @@
-
+
+
+
diff --git a/yuthon_hr_employee_approval/models/yuthon_transfer_approval.py b/yuthon_hr_employee_approval/models/yuthon_transfer_approval.py
index f3f503701..54809ca74 100644
--- a/yuthon_hr_employee_approval/models/yuthon_transfer_approval.py
+++ b/yuthon_hr_employee_approval/models/yuthon_transfer_approval.py
@@ -9,7 +9,7 @@ class YutransferApproval(models.Model):
name = fields.Char(string="标题")
employee_id = fields.Many2one('hr.employee', string="员工姓名")
- documents_ids = fields.Many2many('ir.attachment', string='议题附件')
+ documents_ids = fields.Many2many('ir.attachment', string='附件')
code = fields.Char(string="编号",
default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_leaving_approval_code'))
users_id = fields.Many2one('res.users', string="录入人", default=lambda self: self.env.user.id)
@@ -26,7 +26,6 @@ class YutransferApproval(models.Model):
handover_person_id = fields.Many2one("hr.employee", string="工作接交人")
notification_change_id = fields.Many2one("hr.employee", string="告知人员")
handover_reason = fields.Text(string="移交原因")
- notice_documents_id = fields.Many2one('ir.attachment', string="附件")
reason = fields.Text(string="正文")
is_issues = fields.Boolean(string='是否上会')
issues_result = fields.Html(string="会议结果")
diff --git a/yuthon_hr_employee_approval/views/yuthon_transfer_approval_views.xml b/yuthon_hr_employee_approval/views/yuthon_transfer_approval_views.xml
index aaaf6a54a..8f6845312 100644
--- a/yuthon_hr_employee_approval/views/yuthon_transfer_approval_views.xml
+++ b/yuthon_hr_employee_approval/views/yuthon_transfer_approval_views.xml
@@ -53,7 +53,7 @@
-
+
diff --git a/yuthon_property_approval/views/property_lease_contract.xml b/yuthon_property_approval/views/property_lease_contract.xml
index 42779e740..86a9a7499 100644
--- a/yuthon_property_approval/views/property_lease_contract.xml
+++ b/yuthon_property_approval/views/property_lease_contract.xml
@@ -1101,14 +1101,14 @@
code
action = model.update_property()
-
-
-
-
-
-
-
-
+
+ 管理员强制结束
+
+
+ code
+ action = model.all_end_approval()
+
+
一次性