refactor: exclude balances while setting currency
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js
index 957f734..4847ffd 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.js
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js
@@ -385,13 +385,12 @@
if(!d.account && d.party_type && d.party) {
if(!frm.doc.company) frappe.throw(__("Please select Company"));
return frm.call({
- method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_party_account_and_balance",
+ method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_party_account_and_currency",
child: d,
args: {
company: frm.doc.company,
party_type: d.party_type,
party: d.party,
- cost_center: d.cost_center
}
});
}
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py
index eef23e3..4e425a3 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.py
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py
@@ -1390,21 +1390,14 @@
@frappe.whitelist()
-def get_party_account_and_balance(company, party_type, party, cost_center=None):
+def get_party_account_and_currency(company, party_type, party):
if not frappe.has_permission("Account"):
frappe.msgprint(_("No Permission"), raise_exception=1)
account = get_party_account(party_type, party, company)
- account_balance = get_balance_on(account=account, cost_center=cost_center)
- party_balance = get_balance_on(
- party_type=party_type, party=party, company=company, cost_center=cost_center
- )
-
return {
"account": account,
- "balance": account_balance,
- "party_balance": party_balance,
"account_currency": frappe.get_cached_value("Account", account, "account_currency"),
}