Skip to content

[13.0 --> 14.0] account payment move not reconciliable #3240

@remi-filament

Description

@remi-filament

Module

account

Describe the bug

After migration of v13 DB to v14 using OpenUpgrade, when trying to reconcile a bank statement line with a payment, the following error is raised :
The journal entry BNK1/2022/0051 reached an invalid state regarding its related statement line. To be consistent, the journal entry must always have exactly one journal item involving the bank/cash account.

Analyzing this issue, from my understanding, when reconciling a bank statement line with a payment in Odoo v14, Odoo replaces the Bank Suspense Account in account_move (created automatically from bank_statement_line) by account from reconciled move. In this case, since payment were registered on the same account as bank one (512001), this causes the resulting move with 2 lines on the same bank account. Odoo is expecting to have only one bank account in this move and therefore raises the error.

Basically a customer payment in Odoo 13 and before created the following move lines :
Debit 50 € on account 512001 (Bank)
Credit 50 € on account 411000 (Receivable)

When a payment in Odoo 14 creates the following move lines :
Debit 50 € on account 512003 (Outstanding Receipts)
Credit 50 € on account 411000 (Receivable)

The workaround consists in rewriting the 512001 in 512003 on outstanding payment move lines.
This could be done automatically in post_install script (after outstanding payment account is automatically created in

journal.payment_debit_account_id = env["account.account"].create(
) I am not sure though whether this is a good idea to do that in migration script (since it would rewrite past move lines) ?

To Reproduce

Affected versions: migration 13 to 14

Steps to reproduce the behavior:

  1. Register payment on customer invoice (without reconciliation to bank)
  2. Migrate DB to v14
  3. Create bank statement line for the same amount as the above payment
  4. Try reconciling bank statement line and payment, you should get the same UserError as above

Expected behavior
Reconciliation is properly handled

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions