Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[18.0][FIX] base_tier_validation: Ensure valid recordset assignment in _compute_domain_reviewer_field #1044

Open
wants to merge 1 commit into
base: 18.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions base_tier_validation/models/tier_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,18 @@
@api.depends("review_type", "model_id")
def _compute_domain_reviewer_field(self):
models = self.mapped("model")
IrModelFields = self.env["ir.model.fields"].sudo()

Check warning on line 120 in base_tier_validation/models/tier_definition.py

View check run for this annotation

Codecov / codecov/patch

base_tier_validation/models/tier_definition.py#L120

Added line #L120 was not covered by tests
valid_reviewer_fields = dict(
self.env["ir.model.fields"]
.sudo()
._read_group(
IrModelFields._read_group(
domain=[("model", "in", models), ("relation", "=", "res.users")],
groupby=["model"],
aggregates=["id:array_agg"],
)
)
for rec in self:
rec.valid_reviewer_field_ids = valid_reviewer_fields.get(rec.model, [])
rec.valid_reviewer_field_ids = valid_reviewer_fields.get(

Check warning on line 129 in base_tier_validation/models/tier_definition.py

View check run for this annotation

Codecov / codecov/patch

base_tier_validation/models/tier_definition.py#L129

Added line #L129 was not covered by tests
rec.model, IrModelFields
)

def _get_review_needing_reminder(self):
"""Return all the reviews that have the reminder setup."""
Expand Down