添加功能

This commit is contained in:
李鹏宇
2026-04-24 10:28:36 +08:00
parent 1df0224467
commit 130eaa9cdf
@@ -203,7 +203,7 @@ class SoongWorkflowCommentWizard(models.TransientModel):
record.invalid_link_ids = invalid_links
@api.onchange('trans_employee_ids')
@api.onchange('trans_link_id')
def onchange_trans_employee_ids(self):
for record in self:
record_id = self.env[record.res_model].browse(record.res_id) if record.res_model and record.res_id else None
@@ -228,7 +228,7 @@ class SoongWorkflowCommentWizard(models.TransientModel):
has_exclude_log = record_id.log_ids.filtered(lambda l: l.node_btn_name == '1')
if not has_exclude_log:
# 1. 从 valid_links 里 匹配出 当前流程会经过的【必经节点】
current_mandatory_nodes = self.env['workflow.node']
current_mandatory_nodes = self.env['soong.workflow.node']
for link in valid_links:
link_node = record_id.workflow_id.node_ids.search([
('name', '=', link.name),
@@ -236,6 +236,7 @@ class SoongWorkflowCommentWizard(models.TransientModel):
], limit=1)
if link_node and link_node.is_mandatory_node:
current_mandatory_nodes |= link_node
if not current_mandatory_nodes:
continue
# 2. 取第一个必经节点