From b619c15231268b7a8c63e6774df4b1bed5945eda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?= Date: Fri, 17 Jan 2025 11:27:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=87=87=E8=B4=AD=E5=8D=95?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E6=8E=A5=E6=94=B6=E4=BA=A7=E5=93=81=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jikimo_purchase_tier_validation/models/models.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/jikimo_purchase_tier_validation/models/models.py b/jikimo_purchase_tier_validation/models/models.py index 39e41e1f..085f3b06 100644 --- a/jikimo_purchase_tier_validation/models/models.py +++ b/jikimo_purchase_tier_validation/models/models.py @@ -87,15 +87,14 @@ class jikimo_purchase_tier_validation(models.Model): def _validate_tier(self, tiers=False): res = super(jikimo_purchase_tier_validation, self)._validate_tier(tiers) - tier_reviews = tiers or self.review_ids # 检查是否所有审批都已通过 all_approved = all( tier_review.status == 'approved' - for tier_review in tier_reviews + for tier_review in self.review_ids ) - if all_approved and tier_reviews: # 确保有审批记录 + if self.review_ids and all_approved: # 确保有审批记录 self.state = 'approved' return res