[FIX] account_lock_to_date: fix reversed comparison in fiscalyear lock to date check - #2340
Open
SaraMohamedlorim wants to merge 2 commits into
Open
[FIX] account_lock_to_date: fix reversed comparison in fiscalyear lock to date check#2340SaraMohamedlorim wants to merge 2 commits into
SaraMohamedlorim wants to merge 2 commits into
Conversation
Author
|
The CI failure in All 9 tests in |
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.
Description
Fixes #2334
The
_check_lock_to_datesmethod inres_company.pyhad a reversedcomparison when validating the new
fiscalyear_lock_to_dateagainstthe previous one.
The error message states that the new lock to date for advisors must
be set after the previous lock to date, but the code was actually
raising a
ValidationErrorwhen the new date was later than theold one, and silently allowing the new date to be earlier than
(or equal to) the old one — the exact opposite of the intended and
documented behavior.
Before
After
Tests
Added two new test cases in
test_account_lock_to_date_update.py:test_02b_update_to_later_date_succeeds: confirms that moving thefiscalyear lock to date forward is now allowed.
test_02c_update_to_earlier_date_fails: confirms that moving thefiscalyear lock to date backward is correctly rejected.
All 7 existing tests plus the 2 new ones pass (0 failed, 0 errors).