From d081fa49312b367154f0b7eb83916b2bf54f1eda Mon Sep 17 00:00:00 2001
From: qdp-odoo <qdp@odoo.com>
Date: Tue, 16 Feb 2016 17:38:08 +0100
Subject: [PATCH] [FIX] account: fixed display bug in the manual reconciliation
 widget where currency difference entries where displayed with no amount
 (since they had a currency_id but not amount_currency). In that case, we now
 fallback on the company currency

---
 addons/account/models/account_move.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py
index 26e144976b1a..41d6c0a020b8 100644
--- a/addons/account/models/account_move.py
+++ b/addons/account/models/account_move.py
@@ -535,7 +535,7 @@ class AccountMoveLine(models.Model):
 
         # Return lines formatted
         if len(pairs) > 0:
-            target_currency = self.currency_id or self.company_id.currency_id
+            target_currency = (self.currency_id and self.amount_currency) and self.currency_id or self.company_id.currency_id
             lines = self.browse(list(pairs[0]))
             return lines.prepare_move_lines_for_reconciliation_widget(target_currency=target_currency)
         return []
@@ -630,7 +630,7 @@ class AccountMoveLine(models.Model):
                 'journal_name': line.journal_id.name,
                 'partner_id': line.partner_id.id,
                 'partner_name': line.partner_id.name,
-                'currency_id': line.currency_id.id or False,
+                'currency_id': (line.currency_id and line.amount_currency) and line.currency_id.id or False,
             }
 
             debit = line.debit
@@ -645,7 +645,7 @@ class AccountMoveLine(models.Model):
 
             # Get right debit / credit:
             target_currency = target_currency or company_currency
-            line_currency = line.currency_id or company_currency
+            line_currency = (line.currency_id and line.amount_currency) and line.currency_id or company_currency
             amount_currency_str = ""
             total_amount_currency_str = ""
             if line_currency != company_currency:
-- 
GitLab