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

[FIX] base_tier_validation: Exclude cancel records from pending count #729

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions base_tier_validation/models/res_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ def review_user_count(self):
.search([("id", "in", reviews.mapped("res_id"))])
.filtered(lambda x: not x.rejected and x.can_review)
)
# Excludes any cancelled records depending on the structure of the model
if self.env[model]._state_field in self.env[model]._fields:
records = records.filtered(
lambda x: x[x._state_field] != x._cancel_state
)
# if len(records):
for rec in records:
record = self.env[model]
Expand Down