[Fix] Exchange rate revaluation, get entries not working if accounts of the other currency than company currency not available (#16379)

This commit is contained in:
rohitwaghchaure 2019-01-12 17:58:00 +05:30 committed by Rushabh Mehta
parent 5c86cf54a2
commit ba54209c86
2 changed files with 15 additions and 11 deletions

View File

@ -39,6 +39,8 @@ frappe.ui.form.on('Exchange Rate Revaluation', {
}); });
frm.events.get_total_gain_loss(frm); frm.events.get_total_gain_loss(frm);
refresh_field("accounts"); refresh_field("accounts");
} else {
frappe.msgprint(__("No records found"));
} }
} }
}); });

View File

@ -67,6 +67,8 @@ class ExchangeRateRevaluation(Document):
and account_currency != %s and account_currency != %s
order by name""",(self.company, company_currency)) order by name""",(self.company, company_currency))
account_details = []
if accounts:
account_details = frappe.db.sql(""" account_details = frappe.db.sql("""
select select
account, party_type, party, account_currency, account, party_type, party, account_currency,