-
-
Notifications
You must be signed in to change notification settings - Fork 641
[18.0][IMP] base_tier_validation: handle multiple validations in different states #1228
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
base: 18.0
Are you sure you want to change the base?
[18.0][IMP] base_tier_validation: handle multiple validations in different states #1228
Conversation
|
Hi @LoisRForgeFlow, |
LauraCForgeFlow
left a comment
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.
Functional test LGTM
LoisRForgeFlow
left a comment
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.
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.
StefanRijnhart
left a comment
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 please add a test to illustrate the purpose, and to show that it works well with this refactoring?
964ede3 to
4e049a5
Compare
|
@StefanRijnhart @LoisRForgeFlow added tests! the ci is failing due to this issue not related with the module: odoo/odoo#245835 |
|
@ArnauCForgeFlow can you rebase? the issue with the translation has been fixed upstream. |
4e049a5 to
fd4d58b
Compare
|
@LoisRForgeFlow done! |
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.