Skip to content

Commit

Permalink
Merge PR #757 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by LoisRForgeFlow
  • Loading branch information
OCA-git-bot committed Nov 14, 2023
2 parents de4599b + 353a003 commit 5bfa514
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions base_tier_validation/models/tier_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,12 @@ def _compute_need_validation(self):
if isinstance(rec.id, models.NewId):
rec.need_validation = False
continue
tiers = self.env["tier.definition"].search([("model", "=", self._name)])
tiers = self.env["tier.definition"].search(
[
("model", "=", self._name),
("company_id", "in", [False] + self.env.company.ids),
]
)
valid_tiers = any([rec.evaluate_tier(tier) for tier in tiers])
rec.need_validation = (
not rec.review_ids and valid_tiers and rec._check_state_from_condition()
Expand Down Expand Up @@ -482,7 +487,11 @@ def request_validation(self):
if rec._check_state_from_condition():
if rec.need_validation:
tier_definitions = td_obj.search(
[("model", "=", self._name)], order="sequence desc"
[
("model", "=", self._name),
("company_id", "in", [False] + self.env.company.ids),
],
order="sequence desc",
)
sequence = 0
for td in tier_definitions:
Expand Down

0 comments on commit 5bfa514

Please sign in to comment.