Skip to content

Commit

Permalink
[FIX]base_tier_validation_report: attempt to fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
bosd committed Oct 23, 2023
1 parent 4604e4a commit b04b476
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions base_tier_validation_report/models/tier_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class TierReview(models.Model):
compute_sudo=True,
)

@api.model
def _selection_resource_ref(self):
models = self.env["tier.definition"]._get_tier_validation_model_names()
res = [(m, self.env[m]._description) for m in models]
Expand All @@ -35,12 +36,15 @@ def _selection_resource_ref(self):
@api.depends("model", "res_id")
def _compute_resource_ref(self):
for rec in self:
rec.resource_ref = (
"%s,%s" % (rec.model, rec.res_id) if rec.res_id else False
)
rec.resource_name = rec.resource_ref.display_name
rec.resource_type = rec.model
rec.next_review = rec.resource_ref.next_review
if rec.model and rec.model in self.env:
rec.resource_ref = (
"%s,%s" % (rec.model, rec.res_id) # if rec.res_id else False
)
rec.resource_name = rec.resource_ref.display_name
rec.resource_type = rec.model
rec.next_review = rec.resource_ref.next_review
else:
rec.resource_ref = None

def action_open_resource_ref(self):
self.ensure_one()
Expand Down

0 comments on commit b04b476

Please sign in to comment.