[Solved] Error in Accounts > Balance Sheet

HI all,

Accounts > profit and loss statements > financial statements > Balance sheet

shows the following error!
Traceback (most recent call last):
File “/home/erpnext/frappe-bench/apps/frappe/frappe/app.py”, line 55, in application
response = frappe.handler.handle()
File “/home/erpnext/frappe-bench/apps/frappe/frappe/handler.py”, line 19, in handle
execute_cmd(cmd)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/handler.py”, line 36, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/init.py”, line 882, in call
return fn(*args, **newargs)
File “/home/erpnext/frappe-bench/apps/frappe/frappe/desk/query_report.py”, line 88, in run
res = frappe.get_attr(method_name)(frappe._dict(filters))
File “/home/erpnext/frappe-bench/apps/erpnext/erpnext/accounts/report/balance_sheet/balance_sheet.py”, line 11, in execute
period_list = get_period_list(filters.fiscal_year, filters.periodicity)
TypeError: get_period_list() takes exactly 3 arguments (2 given)

Please help me anybody to solve this error!

Can you please run bench update command and try again.

1 Like

Ensure that you have entered “Fiscal Year” and “Periodicity” filters. Are you getting this error after refreshing as well?

Hello @KanchanChauhan
Yes, i have already tried to update 2 times, it shows following error!

Migrating civil1.erpnext
Updating frappe                     : [========================================]
Updating erpnext                    : [========================================]
Syncing help database...
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/commands/site.py", line 206, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/migrate.py", line 46, in migrate
    frappe.utils.help.sync()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/help.py", line 23, in sync
    help_db.sync_pages()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/help.py", line 117, in sync_pages
    {'docs_base_url': '/assets/{app}_docs'.format(app=app)})
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/jinja.py", line 50, in render_template
    return get_jenv().from_string(template).render(context)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/jinja2/environment.py", line 862, in from_string
    return cls.from_code(self, self.compile(source), globals, None)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/jinja2/environment.py", line 565, in compile
    self.handle_exception(exc_info, source_hint=source_hint)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/jinja2/environment.py", line 754, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "<unknown>", line 33, in template
jinja2.exceptions.TemplateSyntaxError: Expected an expression, got 'end of print statement'
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/home/erpnext/bench-repo/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/erpnext/bench-repo/bench/commands/update.py", line 60, in update
    _update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
  File "/home/erpnext/bench-repo/bench/commands/update.py", line 90, in _update
    patch_sites(bench_path=bench_path)
  File "/home/erpnext/bench-repo/bench/utils.py", line 161, in patch_sites
    run_frappe_cmd('--site', 'all', 'migrate', bench_path=bench_path)
  File "/home/erpnext/bench-repo/bench/utils.py", line 501, in run_frappe_cmd
    raise CommandFailedError(args)
bench.utils.CommandFailedError: ('--site', 'all', 'migrate')

do bench --site site_name migrate

@KanchanChauhan

sorry, my doubt is which site name should i use here?
site name i used in local or in production?

Which branch of frappe are you using? We have fixed a push in develop branch in the last week.

Check this thread:
https://github.com/frappe/erpnext/issues/6174

Hello @nabinhait

Yes, refreshing also shows error!!!

@nabinhait

I am using Master branch of frappe.
and it shows uptodate…

Seems you have generated docs for your custom app which might have a broken jinja template.

We have pushed a fix in develop to skip such templates.

So, either you have to switch to develop branch or make the following changes in your local.

https://github.com/frappe/frappe/commit/19e955f81d549ad9b9a54c2c7455cef6a8afb3e8#diff-0c913d959b814641acbcc7fa5cdaed74R129

Try local.

Helloo @KanchanChauhan @nabinhait

Thank you guys…
Issue is solved when i merged the develop branch to my frappe and did a bench update.
I had some conflicts then. I tried bench update after solved conflicts in the files…
It solved all issues…
Thanks