Balance sheet error

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 55, in application
    response = frappe.handler.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 19, in handle
    execute_cmd(cmd)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 36, in execute_cmd
    ret = frappe.call(method, **frappe.form_dict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 879, in call
    return fn(*args, **newargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/query_report.py", line 88, in run
    res = frappe.get_attr(method_name)(frappe._dict(filters))
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/report/balance_sheet/balance_sheet.py", line 13, in execute
    asset = get_data(filters.company, "Asset", "Debit", period_list, only_current_fiscal_year=False)
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/report/financial_statements.py", line 109, in get_data
    calculate_values(accounts_by_name, gl_entries_by_account, period_list, accumulated_values)
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/report/financial_statements.py", line 127, in calculate_values
    d[period.key] = d.get(period.key, 0.0) + flt(entry.debit) - flt(entry.credit)
AttributeError: 'NoneType' object has no attribute 'get'

try reloading, sometimes these reports has issue clearing cache

Ca’t replicate the issue. Which version are you using? Are you getting this error after some events like renaming of account etc?

I am getting this error after Upgrading to V7 .

Tried all … no results.

Can you explain what you are trying to do, how you are getting to the report, etc?

I am trying to access the Balance Sheet from the Balance sheet tab in Accounts Module.

Its not opening & giving this error.

Seems like nestedset model for account is broken. Can you please run rebuild_tree function from bench console?

Can You Please Help out with the detailed command to be processed . I am using Ubuntu 14.04 and my ERPNext is located at /home/frappe/frappe-bench

@nabinhait sorry for the noob question but how do you run and terminate commands from bench console? What specifically is the sequence to run rebuild_tree?

[root@admin ~]# cd /home/frappe/frappe-bench/
[root@admin frappe-bench]# bench console
Python 2.7.5 (default, Aug 18 2016, 15:58:25)
Type "copyright", "credits" or "license" for more information.

 IPython 4.0.3 -- An enhanced Interactive Python.
 ?         -> Introduction and overview of IPython's features.
 %quickref -> Quick reference.
  help      -> Python's own help system.
 object?   -> Details about 'object', use 'object??' for extra details.

 In [1]:

bench --site <your-site-name> console

And run following in the console:

from frappe.utils.nestedset import rebuild_tree
rebuild_tree('Account', 'parent_account')
frappe.db.commit()

Already executed these commands but problem still their.

Hi @Ashish_Dhingra ,

Did you managed to get this solved? I am having problem on my side too.

Thanks.

Not Yet

I have the same problem.

ERPNext: v8.0.13 (master)
Frappe Framework: v8.0.18 (master)

I think one of your accounts type was changed.

For me I had to go into the database and changed the accounts type.

Ensure that all Warehouse accounts are of Asset type.

Hello,

checked, all my warehouse accounts have type “stock”. Their parent accounts are root type of “asset”

does it have something to do with this thread: [Error] Warehouse balance not matching account balance ?

Please check the “Error Snapshot” for the error traceback. And share the trace along with “Locals” value.

1 Like
[ERROR] 2017-05-29 12:14:15,411 | /home/frappe/frappe-bench/apps/frappe/frappe/app.py:
Site: site1.local
Form Dict: {
 "cmd": "frappe.desk.query_report.run",
 "filters": "{\"company\":\"o10c\",\"from_fiscal_year\":\"2017\",\"to_fiscal_year\":\"2017\",\"periodicity\":\"Monthly\",\"accumulated_values\":1}",
 "report_name": "Balance Sheet"
}
Request Error
Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 55, in application
    response = frappe.handler.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 21, in handle
    data = execute_cmd(cmd)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 52, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 907, in call
    return fn(*args, **newargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/query_report.py", line 94, in run
    res = frappe.get_attr(method_name)(frappe._dict(filters))
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/report/balance_sheet/balance_sheet.py", line 16, in execute
    accumulated_values=filters.accumulated_values)
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/report/financial_statements.py", line 135, in get_data
    calculate_values(accounts_by_name, gl_entries_by_account, period_list, accumulated_values, ignore_accumulated_values_for_fy)
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/report/financial_statements.py", line 156, in calculate_values
    d[period.key] = d.get(period.key, 0.0) + flt(entry.debit) - flt(entry.credit)
AttributeError: 'NoneType' object has no attribute 'get'
[ERROR] 2017-05-29 12:14:15,423 | /home/frappe/frappe-bench/apps/frappe/frappe/utils/error.py:
New Exception collected with id: 2017-05-29 12:14:15.412359-192.168.1.52-26b

is what you need?

No, this is not which I was asking. There is “Error Snapshot” document inside the system for logging the error. Just search for “Error Snapshot” from Awesome Bar, the open the relevant record. Then copy the “Locals” value and share.