[fix] validate_multi_currency

This commit is contained in:
Anand Doshi
2016-01-06 14:16:10 +05:30
parent 03e7e581d8
commit 4774c41958

View File

@@ -280,10 +280,14 @@ class JournalEntry(AccountsController):
alternate_currency = [] alternate_currency = []
for d in self.get("accounts"): for d in self.get("accounts"):
account = frappe.db.get_value("Account", d.account, ["account_currency", "account_type"], as_dict=1) account = frappe.db.get_value("Account", d.account, ["account_currency", "account_type"], as_dict=1)
d.account_currency = account.account_currency or self.company_currency if account:
d.account_type = account.account_type d.account_currency = account.account_currency
d.account_type = account.account_type
if d.account_currency!=self.company_currency and d.account_currency not in alternate_currency: if not d.account_currency:
d.account_currency = self.company_currency
if d.account_currency != self.company_currency and d.account_currency not in alternate_currency:
alternate_currency.append(d.account_currency) alternate_currency.append(d.account_currency)
if alternate_currency: if alternate_currency: