diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js index c98e77fdd2..add3e54d79 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.js +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js @@ -38,7 +38,7 @@ frappe.ui.form.on("Journal Entry", { }, posting_date: function(frm) { - if(!frm.doc.multi_currency) return; + if(!frm.doc.multi_currency || !frm.doc.posting_date) return; $.each(frm.doc.accounts || [], function(i, row) { erpnext.journal_entry.set_exchange_rate(frm, row.doctype, row.name); diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index 5cf2d9277c..0f9b5d34bb 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -832,7 +832,7 @@ def get_account_balance_and_party_type(account, date, company, debit=None, credi # Added posting_date as one of the parameters of get_exchange_rate @frappe.whitelist() -def get_exchange_rate(posting_date, account, account_currency=None, company=None, +def get_exchange_rate(posting_date, account=None, account_currency=None, company=None, reference_type=None, reference_name=None, debit=None, credit=None, exchange_rate=None): from erpnext.setup.utils import get_exchange_rate account_details = frappe.db.get_value("Account", account,