From 3361378bb88e304545a040c8c0b1730da6f73408 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Villarreal=20Ortega?= Date: Tue, 8 Nov 2022 13:49:40 +0100 Subject: [PATCH] [FIX] base_tier_validation_forward: Backward compute after validate previos review --- base_tier_validation_forward/models/tier_validation.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/base_tier_validation_forward/models/tier_validation.py b/base_tier_validation_forward/models/tier_validation.py index 721498f84b..9f92327ad3 100644 --- a/base_tier_validation_forward/models/tier_validation.py +++ b/base_tier_validation_forward/models/tier_validation.py @@ -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 """ @@ -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, @@ -125,3 +127,5 @@ def _create_backward(self, tiers): "origin_id": False, } ) + created_backward_reviews += new_backward_tier + return created_backward_reviews