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
[17.0][RFC] base_tier_validation: remove unused code #824
base: 17.0
Are you sure you want to change the base?
Conversation
Hi @LoisRForgeFlow, |
359fcd6
to
0b71de2
Compare
0b71de2
to
ca73f1c
Compare
the function The remaining code might need some refactoring 🤔 @celm1990 @LoisRForgeFlow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you also explain the other changes?
@@ -15,7 +15,6 @@ def review_user_count(self): | |||
domain = [ | |||
("status", "=", "pending"), | |||
("can_review", "=", True), | |||
("id", "in", self.env.user.review_ids.ids), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to remove this, to make the tests pass.
I'm not seeing in the code where the values to review_ids are written.
(expect for the no longer needed lines in the test)
self.assertTrue(self.test_user_1.get_reviews({"res_ids": review.ids}))
With no valid ID assigned it broke the tests..
(Filtering on the user ID is done, a couple llines below.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe some more refactoring is needed on the domain. (Or an alternative function to write review_ids
) I'm not sure..
@@ -24,7 +23,7 @@ def review_user_count(self): | |||
if reviews: | |||
records = ( | |||
self.env[model] | |||
.with_user(self.env.user) | |||
.sudo() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this. There was an error in the tests. The user is not allowed to acces SO records.
remove the code, which was needed for the review widget pre V16.