[16.0][FIX] contract: preserve manually set recurring_next_date on lines#1449
Closed
maisim wants to merge 1 commit into
Closed
[16.0][FIX] contract: preserve manually set recurring_next_date on lines#1449maisim wants to merge 1 commit into
maisim wants to merge 1 commit into
Conversation
2599d3a to
6947997
Compare
When a user manually modifies recurring_next_date on a contract line that belongs to a contract with line_recurrence=True, the value was overwritten by the cross-dependency recomputation chain: 1. Writing line.recurring_next_date triggers contract._compute_recurring_next_date() (depends on contract_line_ids.recurring_next_date) 2. Contract recomputation triggers line._compute_recurring_next_date() (depends on contract_id.recurring_next_date) 3. super()._compute_recurring_next_date() unconditionally recomputes from next_period_date_start, overwriting the user's value The fix adds a guard (similar to the existing one in the contract model for date_start) that detects manual modifications by comparing rec._origin.recurring_next_date with the current value, and skips the recomputation for records where the user has explicitly set the value. Fixes OCA#1411
6947997 to
fdc01a5
Compare
Author
|
replaced by #1462 |
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.
When a user manually modifies recurring_next_date on a contract line that belongs to a contract with line_recurrence=True, the value was overwritten by the cross-dependency recomputation chain:
The fix adds a guard (similar to the existing one in the contract model for date_start) that detects manual modifications by comparing rec._origin.recurring_next_date with the current value, and skips the recomputation for records where the user has explicitly set the value.
Fixes #1411