Skip to content

[13.0][OU-FIX] account: reversed_entry_id of migrated credit notes - #6048

Open
grojof wants to merge 1 commit into
OCA:13.0from
grojof:13.0-ou_fix-account-reversed_entry_id
Open

grojof wants to merge 1 commit into
OCA:13.0from
grojof:13.0-ou_fix-account-reversed_entry_id

Conversation

@grojof

@grojof grojof commented Oct 1, 2026

Copy link
Copy Markdown

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) and
reversed_entry_id (13.0) are both set on the credit note, but the first query copies it into
reverse_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_id straight into reversed_entry_id, as before #4534. The second
query, 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 twice
with the credit note wizard and reverse a journal entry, then migrate.

13.0 reversed_entry_id before after
invoice one of its credit notes empty
both credit notes empty the invoice
reversed entry the original entry the original entry

A 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.

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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant