show error message if cannot get accounts details (#10768)

This commit is contained in:
tundebabzy 2017-09-13 10:57:30 +01:00 committed by Nabin Hait
parent 52ac483368
commit c050c6945c

View File

@ -142,10 +142,16 @@ def get_data(company, root_type, balance_must_be, period_list, filters=None,
return out
def calculate_values(accounts_by_name, gl_entries_by_account, period_list, accumulated_values, ignore_accumulated_values_for_fy):
for entries in gl_entries_by_account.values():
for entry in entries:
d = accounts_by_name.get(entry.account)
if not d:
frappe.msgprint(
_("Could not retrieve information for {0}.".format(entry.account)), title="Error",
raise_exception=1
)
for period in period_list:
# check if posting date is within the period