[18.0][IMP] base_tier_validation: handle multiple validations in different states#1228
Open
ArnauCForgeFlow wants to merge 2 commits intoOCA:18.0from
Open
Conversation
Contributor
|
Hi @LoisRForgeFlow, |
LoisRForgeFlow
requested changes
Jan 23, 2026
Contributor
LoisRForgeFlow
left a comment
There was a problem hiding this comment.
LG as a first step for multi transition handling!
Could you please add tests for this? you could probably add a new tester model for this specific new case.
Member
StefanRijnhart
left a comment
There was a problem hiding this comment.
Can you please add a test to illustrate the purpose, and to show that it works well with this refactoring?
964ede3 to
4e049a5
Compare
Contributor
Author
|
@StefanRijnhart @LoisRForgeFlow added tests! the ci is failing due to this issue not related with the module: odoo/odoo#245835 |
Contributor
|
@ArnauCForgeFlow can you rebase? the issue with the translation has been fixed upstream. |
4e049a5 to
fd4d58b
Compare
Contributor
Author
|
@LoisRForgeFlow done! |
fd4d58b to
984024c
Compare
984024c to
13cb675
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This Pull Request enables the assignment of multiple tier definitions across different states. This allows us to validate reviews for a specific state without removing previous reviews. Also, when resetting validation, only the reviews corresponding to that specific state will be deleted.
Note: To achieve full functionality, the following two methods must be extended:
_allow_to_remove_reviews()We override this method to prevent the system from automatically clear the existing reviews when performing the transition corresponding to the second validation step (specific state_from → state_to).
_check_allow_write_after_validation()Standard behavior prevents writing to a record once it is validated. We override this to explicitly whitelist the transition defined for the second validation step, returning True. This ensures the specific state change is not blocked by the validation lock mechanisms.
Please note that this implementation is currently a workaround. While it works correctly now, a small refactor to base_tier_validation will be needed in the future to simplify the process and make it cleaner.