Skip to content

Commit

Permalink
[FIX] base_tier_validation_forward: Backward compute after validate p…
Browse files Browse the repository at this point in the history
…revios review
  • Loading branch information
HviorForgeFlow committed Nov 8, 2022
1 parent 025c233 commit 3361378
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions base_tier_validation_forward/models/tier_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,9 @@ def _notify_forwarded_reviews_body(self):

def _validate_tier(self, tiers=False):
self.ensure_one()
self._create_backward(tiers)
backwards = self._create_backward(tiers)
super()._validate_tier(tiers=tiers)
backwards._compute_can_review()

def _create_backward(self, tiers):
""" Find the forward tier that require to backward """
Expand All @@ -114,8 +115,9 @@ def _create_backward(self, tiers):
and r.origin_id.definition_id.has_forward # Forward
and r.origin_id.definition_id.backward # To Backward
)
created_backward_reviews = self.env["tier.review"]
for review in to_backward_reviews:
review.origin_id.copy(
new_backward_tier = review.origin_id.copy(
{
"sequence": round(review.sequence + 0.1, 2),
"done_by": False,
Expand All @@ -125,3 +127,5 @@ def _create_backward(self, tiers):
"origin_id": False,
}
)
created_backward_reviews += new_backward_tier
return created_backward_reviews

0 comments on commit 3361378

Please sign in to comment.