添加功能
This commit is contained in:
@@ -845,13 +845,19 @@ class SoongWorkflowMixin(models.AbstractModel):
|
||||
if current_link and all_links:
|
||||
sorted_all_links = all_links.sorted('sequence')
|
||||
for idx, link in enumerate(sorted_all_links):
|
||||
node_id = self.workflow_id.node_ids.search([
|
||||
('name', '=', link.name),
|
||||
('workflow_id', '=', self.workflow_id.id)
|
||||
], limit=1)
|
||||
# 本节点指定的"前置节点"仍出现在可选列表中(即它可以选择)→ 本节点直接跳过,
|
||||
# 且本节点的"相同人员节点处理"也随之不触发
|
||||
if node_id and node_id.skip_if_node_id and node_id.skip_if_node_id != node_id:
|
||||
if any(l.name == node_id.skip_if_node_id.name for l in sorted_all_links):
|
||||
invalid_links |= link
|
||||
continue
|
||||
approvers = self._get_approvers_for_link(link, self)
|
||||
if len(approvers) == 1:
|
||||
current_approver = approvers[0]
|
||||
node_id = self.workflow_id.node_ids.search([
|
||||
('name', '=', link.name),
|
||||
('workflow_id', '=', self.workflow_id.id)
|
||||
], limit=1)
|
||||
if node_id:
|
||||
# 下一个相同审批人跳过
|
||||
if node_id.same_user_skip_type == 'next':
|
||||
|
||||
@@ -108,6 +108,13 @@ class SoongWorkflowNode(models.Model):
|
||||
('prev', '跳过上一个相同人员节点'),
|
||||
('after', '跳过此节点之后的所有相同人员节点'),
|
||||
], string='相同人员节点处理', default='none')
|
||||
skip_if_node_id = fields.Many2one(
|
||||
'soong.workflow.node',
|
||||
string='前置节点',
|
||||
domain="[('workflow_id', '=', workflow_id), ('id', '!=', id)]",
|
||||
help="选择一个位于本节点之前的节点:若它在流转时仍出现在可选节点中(即它可以选择),"
|
||||
"则本节点会被自动跳过;本节点被跳过时,其上配置的「相同人员节点处理」不再触发。",
|
||||
)
|
||||
is_mandatory_node = fields.Boolean(string="必经节点", default=False)
|
||||
|
||||
@api.onchange("is_apostille")
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
<field name="end_comment_id"/>
|
||||
<field name="is_mandatory_node"/>
|
||||
<field name="same_user_skip_type"/>
|
||||
<field name="skip_if_node_id"/>
|
||||
<field name="illustrate"/>
|
||||
</group>
|
||||
<group>
|
||||
|
||||
Reference in New Issue
Block a user