Skip to content

Commit 3cb9cf9

Browse files
committed
[FIX] base_tier_validation: approve by pass sequence continue only
1 parent 86aecb3 commit 3cb9cf9

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

base_tier_validation/models/tier_validation.py

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -533,9 +533,26 @@ def _validate_tier(self, tiers=False):
533533
}
534534
)
535535

536-
user_reviews = tier_reviews.filtered(
537-
lambda r: r.status == "pending" and (self.env.user in r.reviewer_ids)
538-
)
536+
user_reviews = self.env[tier_reviews._name]
537+
found_start = False
538+
539+
for review in tier_reviews:
540+
is_match = review.status == "pending" and (
541+
self.env.user in review.reviewer_ids
542+
)
543+
if is_match and not found_start:
544+
found_start = True
545+
user_reviews |= review
546+
if not review.approve_sequence_bypass:
547+
break
548+
continue
549+
550+
if is_match and found_start:
551+
user_reviews |= review
552+
553+
if not is_match and found_start:
554+
break
555+
539556
user_reviews.write(
540557
{
541558
"status": "approved",

0 commit comments

Comments
 (0)