diff options
| author | Cedric Snauwaert <csn@openerp.com> | 2016-07-27 15:03:08 +0200 |
|---|---|---|
| committer | Cedric Snauwaert <csn@openerp.com> | 2016-08-01 10:01:12 +0200 |
| commit | 9b5fed49769d2e010f29f73b0f288de63bd26bc4 (patch) | |
| tree | 0d8995715f1303d6490b71fb7b8e14eb3bab4792 | |
| parent | 09e943429ee2b1e25b5179927c9a3a62b78cd76e (diff) | |
[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.
| -rw-r--r-- | addons/account/models/account_move.py | 4 |
1 files changed, 3 insertions, 1 deletions
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 |
