Browse Source

add 'can_review' to tier.validation so that the buttons approve

and reject can be hidden according to this computed field.
pull/52/head
Jordi Ballester Alomar 6 years ago
committed by Naglis Jonaitis
parent
commit
27534c1509
No known key found for this signature in database GPG Key ID: 4748835F585390F5
  1. 6
      base_tier_validation/models/tier_validation.py

6
base_tier_validation/models/tier_validation.py

@ -33,6 +33,12 @@ class TierValidation(models.AbstractModel):
compute="_compute_reviewer_ids",
search="_search_reviewer_ids",
)
can_review = fields.Boolean(compute="_compute_can_review")
@api.multi
def _compute_can_review(self):
for rec in self:
rec.can_review = self.env.user in rec.reviewer_ids
@api.multi
@api.depends('review_ids')

Loading…
Cancel
Save