From 0ac4c09d77d3d58116a9e9d59f4c22855c483844 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?=
<9664676+pengyuthon@user.noreply.gitee.com>
Date: Tue, 6 Jan 2026 17:19:06 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
soong_workflow/models/soong_workflow_record.py | 9 +++++++++
soong_workflow/views/soong_workflow_record.xml | 3 ++-
soong_workflow/wizard/soong_workflow_comment_wizard.py | 7 ++++---
yuthon_issue/models/inherit_room_booking.py | 3 +++
yuthon_official/models/yuthon_official.py | 2 +-
5 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/soong_workflow/models/soong_workflow_record.py b/soong_workflow/models/soong_workflow_record.py
index 6dc568880..348b16a40 100644
--- a/soong_workflow/models/soong_workflow_record.py
+++ b/soong_workflow/models/soong_workflow_record.py
@@ -57,6 +57,7 @@ class SoongWorkflowRecord(models.Model):
# 人力资源流程的发生日期
workflow_happen_date = fields.Date(string="发生日期")
+ is_unlink = fields.Boolean(string="是否可删", compute='_compute_is_unlink')
@api.depends_context('uid', 'company')
@api.depends('department_id', 'employee_ids')
@@ -77,6 +78,14 @@ class SoongWorkflowRecord(models.Model):
has_valid_employee = bool(record.employee_ids & valid_employee_ids)
record.member_of_department = has_valid_employee
+ @api.depends('create_uid', 'employee_ids')
+ def _compute_is_unlink(self):
+ for record in self:
+ if len(record.employee_ids) == 1 and record.employee_ids.user_id.id == record.create_uid.id:
+ record.is_unlink = True
+ else:
+ record.is_unlink = False
+
def _get_valid_employee_for_user(self):
user = self.env.user
employee = user.employee_ids
diff --git a/soong_workflow/views/soong_workflow_record.xml b/soong_workflow/views/soong_workflow_record.xml
index b3af83edf..6d520c8fd 100644
--- a/soong_workflow/views/soong_workflow_record.xml
+++ b/soong_workflow/views/soong_workflow_record.xml
@@ -133,8 +133,9 @@
+
+ invisible="not is_unlink"/>
diff --git a/soong_workflow/wizard/soong_workflow_comment_wizard.py b/soong_workflow/wizard/soong_workflow_comment_wizard.py
index bd5bf5923..506c66987 100644
--- a/soong_workflow/wizard/soong_workflow_comment_wizard.py
+++ b/soong_workflow/wizard/soong_workflow_comment_wizard.py
@@ -555,7 +555,7 @@ class SoongWorkflowCommentWizard(models.TransientModel):
'comment': self.comment,
'approval_state': "3",
'lase_click_date': fields.Datetime.now() - timedelta(hours=8),
- 'document_ids': [(6, 0, self.document_ids.ids)] # Many2many 替换语法
+ 'document_ids': [(6, 0, self.document_ids.ids)]
}
record_id.log_ids[-1].sudo().write(write_vals)
record_id.work_end = True
@@ -651,6 +651,8 @@ class SoongWorkflowCommentWizard(models.TransientModel):
title=record_id._description,
description=f"编号为{record_id.code}的{record_id._description}已结束,请归档",
url=url, btntxt="查看详情")
+ return self.node_btn_id.with_context(cx).run()
+
if self.node_btn_name == "分发":
if self.employee_ids:
record_id.log_ids[-1].write({"comment": self.comment,
@@ -719,6 +721,7 @@ class SoongWorkflowCommentWizard(models.TransientModel):
title=record_id._description + "承办",
description=description, url=url,
btntxt="查看详情")
+ return self.node_btn_id.with_context(cx).run()
if self.node_btn_name == "收回":
# recall_url = f'https://qyapi.weixin.qq.com/cgi-bin/message/recall?access_token={access_token}'
@@ -741,8 +744,6 @@ class SoongWorkflowCommentWizard(models.TransientModel):
record.write({'state': 'draft', 'work_end': False})
else:
record.write({'state': log_ids[-2].name, 'work_end': False})
- return self.node_btn_id.with_context(cx).run()
-
def update_self_users_ids(self):
related_record = self.env[self.res_model].browse(self.res_id)
diff --git a/yuthon_issue/models/inherit_room_booking.py b/yuthon_issue/models/inherit_room_booking.py
index b21df9660..b4792751e 100644
--- a/yuthon_issue/models/inherit_room_booking.py
+++ b/yuthon_issue/models/inherit_room_booking.py
@@ -105,9 +105,12 @@ class IssueMeetingLine(models.Model):
if self.decision_results == 'agree':
is_agree = 'pass'
agree_name = '通过'
+ issue_state = 'on_meet'
else:
is_agree = 'reject'
agree_name = '未通过'
+ issue_state = 'will'
+ self.issue_library_id.issue_state = issue_state
if '党' in meeting_type_name:
self.issue_library_id.is_party_passed = is_agree
original_party_char = self.issue_library_id.party_char or ""
diff --git a/yuthon_official/models/yuthon_official.py b/yuthon_official/models/yuthon_official.py
index bd984debb..feb372e94 100644
--- a/yuthon_official/models/yuthon_official.py
+++ b/yuthon_official/models/yuthon_official.py
@@ -34,7 +34,7 @@ class YuthonOfficial(models.Model):
date = fields.Datetime(string="拟稿日期", default=fields.Datetime.now)
official_statu = fields.Selection([('done', '办结'), ('approval', '审核')], string="公文环节")
users_id = fields.Many2one('res.users', string="拟稿人", default=lambda self: self.env.user)
- department_id = fields.Many2one(related='users_id.employee_id.department_id', string="拟稿部门")
+ department_id = fields.Many2one(related='users_id.employee_ids.department_id', string="拟稿部门")
company_id = fields.Many2one(related='users_id.company_id', string="公司")
company_id1 = fields.Many2one('res.company', string="公司前缀", default=lambda self: self.env.company)
is_meet = fields.Boolean(string="是否上会")