From dd72112b356cd9cefd3fd66cd980ef4c5f5f1160 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: Wed, 29 Jul 2026 17:31:51 +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_mixin.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/soong_workflow/models/soong_workflow_mixin.py b/soong_workflow/models/soong_workflow_mixin.py index 3c209ce7b..1fc19f4d9 100644 --- a/soong_workflow/models/soong_workflow_mixin.py +++ b/soong_workflow/models/soong_workflow_mixin.py @@ -1200,8 +1200,8 @@ class SoongWorkflowMixin(models.AbstractModel): if button.has_icon: btn_exec_action_el.set("icon", button.icon) invisible_condition = "state != '%s'" % node.node_name - # 采购订单流程结束后state会回到purchase,确认按钮需要额外允许该状态 - if button.name == '确认' and model == 'purchase.order': + # 采购订单流程结束后state会回到purchase,仅最后一个节点的确认按钮额外允许该状态 + if button.name == '确认' and model == 'purchase.order' and node.is_end: invisible_condition = "state not in ('%s', 'purchase')" % node.node_name # if model == 'purchase.order': # invisible_condition = invisible_condition.replace("询价", "draft") @@ -1278,7 +1278,8 @@ class SoongWorkflowMixin(models.AbstractModel): id_el = etree.Element("field") id_el.set("name", "log_ids") id_el.set("invisible", "1") - if model == 'purchase.order': + # 采购订单流程结束后state会回到purchase,仅最后一个节点的确认按钮额外允许该状态 + if model == 'purchase.order' and node.is_end: invisible = "state not in ('%s', 'purchase') or not is_confirm" % node.node_name else: invisible += "or not is_confirm"