From 8a4bdfb2b18445efcb32c22cedcc69f04845a354 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Wed, 12 Oct 2016 15:59:29 +0200 Subject: [PATCH] [FIX] account: multi-currency reconciliation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reconcile the following entries : D C Amount currency 3.655,52€ +3.872,45$ 3.436,80€ -3.872,45$ What Odoo does when I reconcile the 2 entries above using the "Reconcile" button: D C Amount currency 3.655,52€ +3.872,45$ 3.436,80€ -3.872,45$ 0€ 218,72€ -236,61$ 0€ 0€ +236,61$ What Odoo should do : D C Amount currency 3.655,52€ +3.872,45$ 3.436,80€ -3.872,45$ 0€ 218,72€ 0$ opw-687481 --- addons/account/models/account_move.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 48dc26141b8..03d54cdb584 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -1071,10 +1071,13 @@ class AccountMoveLine(models.Model): # the provided values were not already multi-currency if account.currency_id and 'amount_currency' not in vals and account.currency_id.id != account.company_id.currency_id.id: vals['currency_id'] = account.currency_id.id - ctx = {} - if 'date' in vals: - ctx['date'] = vals['date'] - vals['amount_currency'] = account.company_id.currency_id.with_context(ctx).compute(amount, account.currency_id) + if self._context.get('skip_full_reconcile_check') == 'amount_currency_excluded': + vals['amount_currency'] = 0.0 + else: + ctx = {} + if 'date' in vals: + ctx['date'] = vals['date'] + vals['amount_currency'] = account.company_id.currency_id.with_context(ctx).compute(amount, account.currency_id) if not ok: raise UserError(_('You cannot use this general account in this journal, check the tab \'Entry Controls\' on the related journal.'))