frappe/erpnext

[Bug] After Update to v15.46.0 (version-15) - All Financial Report Can't Open

Closed this issue ยท 3 comments

Information about bug

Hello @ruthra-kumar ,

Following the latest update, I am unable to access all financial statements reports.

The affected reports include:

  • Balance Sheet
  • Profit and Loss
  • Cash Flow

Could you please assist me in resolving this issue?

image

Thanks,

Donnie

Module

accounts

Version

ERPNext: v15.46.0 (version-15)
Frappe Framework: v15.50.1 (version-15)
Frappe HR: v15.36.0 (version-15)
Payments: v0.0.1 (version-15)
Print Designer: v1.4.3 (main)
Webshop: v0.0.1 (develop)

Installation method

manual install

Relevant log output / Stack trace / Full Error Message.

### App Versions

{
	"erpnext": "15.46.0",
	"frappe": "15.50.1",
	"hrms": "15.36.0",
	"payments": "0.0.1",
	"print_designer": "1.4.3",
	"webshop": "0.0.1"
}

Route

query-report/Balance Sheet

Traceback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 114, in application
    response = frappe.api.handle(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/api/__init__.py", line 49, in handle
    data = endpoint(**arguments)
           ^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call
    return frappe.handler.handle()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/handler.py", line 50, in handle
    data = execute_cmd(cmd)
           ^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/handler.py", line 86, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/__init__.py", line 1726, in call
    return fn(*args, **newargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/__init__.py", line 879, in wrapper_fn
    retval = fn(*args, **get_newargs(fn, kwargs))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/desk/query_report.py", line 224, in run
    result = generate_report_result(report, filters, user, custom_columns, is_tree, parent_field)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/__init__.py", line 879, in wrapper_fn
    retval = fn(*args, **get_newargs(fn, kwargs))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/desk/query_report.py", line 84, in generate_report_result
    res = get_report_result(report, filters) or []
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/desk/query_report.py", line 65, in get_report_result
    res = report.execute_script_report(filters)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/core/doctype/report/report.py", line 163, in execute_script_report
    res = self.execute_module(filters)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/core/doctype/report/report.py", line 180, in execute_module
    return frappe.get_attr(method_name)(frappe._dict(filters))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/erpnext/erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.py", line 30, in execute
    income = get_data(
             ^^^^^^^^^
  File "apps/erpnext/erpnext/accounts/report/financial_statements.py", line 182, in get_data
    set_gl_entries_by_account(
  File "apps/erpnext/erpnext/accounts/report/financial_statements.py", line 466, in set_gl_entries_by_account
    gl_entries += get_accounting_entries(
                  ^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/erpnext/erpnext/accounts/report/financial_statements.py", line 537, in get_accounting_entries
    query, params = query.walk()
                    ^^^^^^^^^^^^
  File "apps/frappe/frappe/query_builder/utils.py", line 111, in prepare_query
    query = query.get_sql(param_wrapper=param_collector)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "env/lib/python3.11/site-packages/pypika/queries.py", line 607, in get_sql
    set_operation_querystring = set_operation_query.get_sql(
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'get_sql'

Request Data

{
	"type": "POST",
	"args": {
		"report_name": "Profit and Loss Statement",
		"filters": "{\"company\":\"Area51 Distribution Manado\",\"filter_based_on\":\"Fiscal Year\",\"period_start_date\":\"2024-01-01\",\"period_end_date\":\"2024-12-31\",\"from_fiscal_year\":\"2024\",\"to_fiscal_year\":\"2024\",\"periodicity\":\"Monthly\",\"selected_view\":\"Report\",\"accumulated_values\":0}",
		"ignore_prepared_report": 1
	},
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/frappe.desk.query_report.run",
	"request_id": null
}

Response Data

{
	"exception": "AttributeError: 'str' object has no attribute 'get_sql'",
	"exc_type": "AttributeError",
	"_exc_source": "erpnext (app)"
}

๐ŸŽ‰ This issue has been resolved in version 14.78.4 ๐ŸŽ‰

The release is available on GitHub release

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

๐ŸŽ‰ This issue has been resolved in version 14.78.5 ๐ŸŽ‰

The release is available on GitHub release

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€