Skip to content

[19.0][OU-FIX] account: link exchange move to an existing partial - #6114

Open
JordiBForgeFlow wants to merge 2 commits into
OCA:19.0from
ForgeFlow:19.0-fix-account-exchange-move-partial
Open

JordiBForgeFlow wants to merge 2 commits into
OCA:19.0from
ForgeFlow:19.0-fix-account-exchange-move-partial

Conversation

@JordiBForgeFlow

Copy link
Copy Markdown
Member

The migration of account.full.reconcile#exchange_move_id copied the last partial
reconciliation of each full reconciliation to hold the exchange move. The copy keeps the
amount, so every line of those reconciliations gets the amount counted twice: lines are
no longer reconciled, residuals appear and invoices go from paid to partial.

This links the exchange move to an existing partial reconciliation of the full
reconciliation instead, without creating any new partial.

Steps to reproduce:

  1. In 18.0, have a full reconciliation with an exchange difference move (an invoice in
    a foreign currency paid at a different rate).
  2. Migrate to 19.0.
  3. The invoice shows as partially paid, and the lines of the reconciliation have a
    residual equal to the amount of the copied partial.

Expected: the invoice stays paid and the partials, residuals and payment states match
18.0. Checked on a production database with about 18,000 full reconciliations: after
the fix, account moves, lines, partials and open items by partner match 18.0.

The first commit extends the migration test to check that the lines of the full
reconciliation stay reconciled with no residual: it fails without the fix
(reconciled is False) and passes with it.

Assisted by AI

The test only checked that the exchange move was linked to a partial
reconciliation of the full reconciliation, which a copy of a partial also
satisfies. Check that the lines of the full reconciliation are still
reconciled and keep no residual, in company or foreign currency.
The migration of account.full.reconcile#exchange_move_id copied the last
partial reconciliation of each full reconciliation to hold the exchange
move. The copy keeps the amount, so every line of those reconciliations
gets the amount counted twice: lines are no longer reconciled, residuals
appear and invoices go from paid to partial. Link the exchange move to
an existing partial reconciliation instead.
@OCA-git-bot OCA-git-bot added mod:openupgrade_scripts Module openupgrade_scripts series:19.0 labels Nov 23, 2026
@rrebollo

Copy link
Copy Markdown

I can review this in exchange for a review of #6113 (18.0 product defaults migration). Would that work?

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

mod:openupgrade_scripts Module openupgrade_scripts series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants