Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[minor] added currency in Totals for Trial Balance report #8757

Merged
merged 2 commits into from
May 10, 2017

Conversation

mbauskar
Copy link
Contributor

ERROR Report

Traceback (most recent call last):
  File "/home/frappe/benches/bench-2017-05-09/apps/frappe/frappe/app.py", line 55, in application
    response = frappe.handler.handle()
  File "/home/frappe/benches/bench-2017-05-09/apps/frappe/frappe/handler.py", line 21, in handle
    data = execute_cmd(cmd)
  File "/home/frappe/benches/bench-2017-05-09/apps/frappe/frappe/handler.py", line 52, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/frappe/benches/bench-2017-05-09/apps/frappe/frappe/__init__.py", line 907, in call
    return fn(*args, **newargs)
  File "/home/frappe/benches/bench-2017-05-09/apps/frappe/frappe/desk/query_report.py", line 103, in run
    result = get_filtered_data(report.ref_doctype, columns, result, user)
  File "/home/frappe/benches/bench-2017-05-09/apps/frappe/frappe/desk/query_report.py", line 234, in get_filtered_data
    elif has_match(row, linked_doctypes, match_filters_per_doctype, ref_doctype, if_owner, columns_dict, user):
  File "/home/frappe/benches/bench-2017-05-09/apps/frappe/frappe/desk/query_report.py", line 279, in has_match
    if dt in match_filters and row[idx] not in match_filters[dt]:
KeyError: u'currency'

Total values

screen shot 2017-05-10 at 3 39 50 pm

@mbauskar mbauskar requested a review from nabinhait May 10, 2017 10:10
@@ -137,7 +137,8 @@ def calculate_values(accounts, gl_entries_by_account, opening_balances, filters)
"credit": 0.0,
"parent_account": None,
"indent": 0,
"has_value": True
"has_value": True,
"currency": frappe.db.get_value("Company", filters.company, "default_currency")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use erpnext.get_company_currency(), it does caching. Also, company_currency is evaluated in prepare_data as well, call it only one time

@nabinhait nabinhait merged commit 464f108 into frappe:develop May 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants