diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js index b1c355b375..479eaafd23 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.js +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js @@ -368,10 +368,6 @@ frappe.ui.form.on("Journal Entry Account", { credit: function(frm, dt, dn) { cur_frm.cscript.update_totals(frm.doc); - }, - - exchange_rate: function(frm, cdt, cdn) { - erpnext.journal_entry.set_debit_credit_in_company_currency(frm, cdt, cdn); } }) @@ -418,7 +414,7 @@ $.extend(erpnext.journal_entry, { if(row.account_currency == company_currency || !frm.doc.multi_currency) { frappe.model.set_value(cdt, cdn, "exchange_rate", 1); - } else if (!row.exchange_rate || row.account_type == "Bank") { + } else if (!row.exchange_rate || row.exchange_rate == 1 || row.account_type == "Bank") { frappe.call({ method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_exchange_rate", args: { diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index eefa0db1bb..c540582802 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -295,7 +295,7 @@ class JournalEntry(AccountsController): for d in self.get("accounts"): if d.account_currency == self.company_currency: d.exchange_rate = 1 - elif not d.exchange_rate or d.account_type=="Bank" or \ + elif not d.exchange_rate or d.exchange_rate == 1 or \ (d.reference_type in ("Sales Invoice", "Purchase Invoice") and d.reference_name): d.exchange_rate = get_exchange_rate(d.account, d.account_currency, self.company, d.reference_type, d.reference_name, d.debit, d.credit, d.exchange_rate)