From 9b5fed49769d2e010f29f73b0f288de63bd26bc4 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Wed, 27 Jul 2016 15:03:08 +0200 Subject: [PATCH] [FIX] account: fix full reconciliation. when doing a full reconciliation in the same currency, full_reconcile_id was not set on account_partial_reconcile object resulting in problem when trying to unreconcile entries. Also add matching number to the exchanged rate entries created in case of full reconciliation. --- addons/account/models/account_move.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index d3b9b60581f..5676536425a 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -948,13 +948,15 @@ class AccountMoveLine(models.Model): currency = aml.currency_id if aml.currency_id and aml.currency_id == currency: total_amount_currency += aml.amount_currency - partial_rec_set |= aml.matched_debit_ids | aml.matched_credit_ids + partial_rec_set |= aml.matched_debit_ids | aml.matched_credit_ids if currency and aml_to_balance_currency: aml = aml_to_balance_currency[0] #eventually create journal entries to book the difference due to foreign currency's exchange rate that fluctuates partial_rec = aml.credit and aml.matched_debit_ids[0] or aml.matched_credit_ids[0] aml_id, partial_rec_id = partial_rec.with_context(skip_full_reconcile_check=True).create_exchange_rate_entry(aml_to_balance_currency, 0.0, total_amount_currency, currency, maxdate) + self |= aml_id + partial_rec_set |= partial_rec_id partial_rec_ids = [x.id for x in list(partial_rec_set)] #if the total debit and credit are equal, and the total amount in currency is 0, the reconciliation is full