-
-
Notifications
You must be signed in to change notification settings - Fork 784
Description
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( |
To Reproduce
Affected versions: migration 13 to 14
Steps to reproduce the behavior:
- Register payment on customer invoice (without reconciliation to bank)
- Migrate DB to v14
- Create bank statement line for the same amount as the above payment
- Try reconciling bank statement line and payment, you should get the same UserError as above
Expected behavior
Reconciliation is properly handled