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

[17.0][RFC] base_tier_validation: remove unused code #824

Open
wants to merge 1 commit into
base: 17.0
Choose a base branch
from

Conversation

bosd
Copy link
Contributor

@bosd bosd commented Feb 11, 2024

remove the code, which was needed for the review widget pre V16.

@OCA-git-bot
Copy link
Contributor

Hi @LoisRForgeFlow,
some modules you are maintaining are being modified, check this out!

@bosd bosd force-pushed the 17.0-imp-clean-base_tier_validation branch 2 times, most recently from 359fcd6 to 0b71de2 Compare February 11, 2024 23:33
@bosd bosd force-pushed the 17.0-imp-clean-base_tier_validation branch from 0b71de2 to ca73f1c Compare February 13, 2024 20:26
@bosd
Copy link
Contributor Author

bosd commented Feb 13, 2024

the function get_reviews was no longer called upon in the javascript. After this commit.
145c570#diff-5d679fcb388f892b31b8c390404d207ed9b96c806e57db499e13d04443d628e9L33
(or anywhere else afaik)
But it still was unit tested.

The remaining code might need some refactoring 🤔

@celm1990 @LoisRForgeFlow
Can you please review / provide feedback?

@bosd bosd marked this pull request as ready for review February 13, 2024 20:39
Copy link
Contributor

@LoisRForgeFlow LoisRForgeFlow left a 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),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this

Copy link
Contributor Author

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.)

Copy link
Contributor Author

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()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants