From a1aed26d52b65dea455363c4e8c790014e1c9ddd Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 10 May 2017 10:23:31 +0200 Subject: [PATCH] [FIX] account: Payment cancelled when cancelling statement line Steps to reproduce: 1. Create a payment of 999 with bank 2. Create a statement line of 1000 on bank journal 3. Go to reconcile interface, choose the 999 line and make an adjustment of 1 4. The payment has been reconciled with the statement line, and one new journal entry has been created for adjustment of "1" 5. Cancel statement line (you need to enable this functionality on bank journal) Bug:The payment journal entry of 999 is deleted and payment remains confirmed After the fix: The payment journal entry of 999 is UNRECONCILED and the payment entry still exists. opw:741619 --- addons/account/models/account_bank_statement.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py index 157fdbedf4a..01573491a69 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -424,7 +424,7 @@ class AccountBankStatementLine(models.Model): payment_to_unreconcile |= line.payment_id if st_line.move_name and line.payment_id.payment_reference == st_line.move_name: #there can be several moves linked to a statement line but maximum one created by the line itself - moves_to_cancel |= st_line.journal_entry_ids + moves_to_cancel |= move payment_to_cancel |= line.payment_id moves_to_unbind = moves_to_unbind - moves_to_cancel