From f7971a95c9486f9024ee0b4c0086aa3ce2a99c05 Mon Sep 17 00:00:00 2001 From: qdp-odoo Date: Wed, 28 Mar 2018 10:37:41 +0200 Subject: [PATCH] [FIX] account: yet another multicurrency fix function create_exchange_rate_entry() has been build to potentially receive several aml_to_balance (all sharing the same currency_id), hence aml_to_balance.currency_id would be failing in that case since the ORM is expecting a singleton there. --- addons/account/models/account_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index d7916aaa826..329d06042dc 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -1878,7 +1878,7 @@ class AccountPartialReconcile(models.Model): exchange_move = self.env['account.move'].create( self.env['account.full.reconcile']._prepare_exchange_diff_move(move_date=maxdate, company=aml_to_balance[0].company_id)) #eventually create a journal entry to book the difference due to foreign currency's exchange rate that fluctuates - rate_diff_amls, rate_diff_partial_rec = self.create_exchange_rate_entry(aml_to_balance, total_debit - total_credit, total_amount_currency, aml_to_balance.currency_id, exchange_move) + rate_diff_amls, rate_diff_partial_rec = self.create_exchange_rate_entry(aml_to_balance, total_debit - total_credit, total_amount_currency, aml_to_balance[0].currency_id, exchange_move) aml_ids += rate_diff_amls.ids partial_rec_ids += rate_diff_partial_rec.ids exchange_move.post()