Repository navigation
Conversation
refund_invoice_id and reversed_entry_id are both set on the credit note and point to the invoice. Copying refund_invoice_id into reverse_entry_id, which 12.0 sets on the original move, inverted the link: the invoice ended up as the "Reversal of" its credit note, and an invoice with several credit notes kept only one of them. Assisted-by: Claude Opus 5.5
This branch has not been deployed
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.
Since #4534, migrated credit notes have their link inverted: the invoice becomes the "Reversal of"
its credit note, and the credit note links to nothing.
refund_invoice_id(12.0) andreversed_entry_id(13.0) are both set on the credit note, but the first query copies it intoreverse_entry_id, which 12.0 sets on the original move, so the second query turns it round.An invoice with several credit notes keeps only one of them.
The fix copies
refund_invoice_idstraight intoreversed_entry_id, as before #4534. The secondquery, for moves reversed with 12.0's own reversal, is unchanged.
To reproduce: on 12.0 without demo data (
account,l10n_generic_coa), refund an invoice twicewith the credit note wizard and reverse a journal entry, then migrate.
reversed_entry_idA credit note created in 13.0 with the reversal wizard gets the same link as after the fix.
This contribution was prepared with AI assistance (Claude Opus 5.5), and reviewed and tested by me. The
commit carries an
Assisted-by:trailer, per the OCA AI policy.