No module named 'frappe.utils.modules' Possible source of error: crm (app)

After updating to “erpnext”: “15.58.1” and “frappe”: “15.65.0”, I got an error Server error ModuleNotFoundError: No module named ‘frappe.utils.modules’ Possible source of error: crm (app).
I noticed this when I tried to charge names of accounts in the chart of account.

Kindly help.

Below is the error :

App Versions

{
	"agriculture": "0.0.1",
	"builder": "2.0.0-dev",
	"crm": "2.0.0-dev",
	"erpnext": "15.58.1",
	"frappe": "15.65.0",
	"helpdesk": "1.7.0",
	"hrms": "16.0.0-dev",
	"lending": "0.0.1",
	"payments": "0.0.1",
	"webshop": "0.0.1"
}

Route

setup-wizard/0

Traceback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 115, 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 51, in handle
    data = execute_cmd(cmd)
           ^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/handler.py", line 84, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/__init__.py", line 1739, 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/desk/page/setup_wizard/setup_wizard.py", line 61, in setup_complete
    return process_setup_stages(stages, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/desk/page/setup_wizard/setup_wizard.py", line 81, in process_setup_stages
    task.get("fn")(task.get("args"))
  File "apps/frappe/frappe/desk/page/setup_wizard/setup_wizard.py", line 111, in update_global_settings
    create_or_update_user(args)
  File "apps/frappe/frappe/desk/page/setup_wizard/setup_wizard.py", line 226, in create_or_update_user
    user.insert()
  File "apps/frappe/frappe/model/document.py", line 309, in insert
    self.run_before_save_methods()
  File "apps/frappe/frappe/model/document.py", line 1130, in run_before_save_methods
    self.run_method("before_validate")
  File "apps/frappe/frappe/model/document.py", line 1007, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/document.py", line 1364, in composer
    hooks.append(frappe.get_attr(handler))
                 ^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/__init__.py", line 1729, in get_attr
    return getattr(get_module(modulename), methodname)
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/__init__.py", line 1439, in get_module
    return importlib.import_module(modulename)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1310, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "apps/crm/crm/api/__init__.py", line 6, in <module>
    from frappe.utils.modules import get_modules_from_all_apps_for_user
ModuleNotFoundError: No module named 'frappe.utils.modules'

Request Data

{
	"type": "POST",
	"args": {
		"args": "{\"language\":\"English\",\"country\":\"Uganda\",\"timezone\":\"Africa/Kampala\",\"currency\":\"UGX\",\"full_name\":\"Tom\",\"email\":\"ssemwogerere.farmer@gmail.com\",\"password\":\"Tsmo1972\",\"company_name\":\"kdc\",\"company_abbr\":\"Kdc\",\"chart_of_accounts\":\"Standard\",\"fy_start_date\":\"2025-01-01\",\"fy_end_date\":\"2025-12-31\",\"setup_demo\":0}"
	},
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/frappe.desk.page.setup_wizard.setup_wizard.setup_complete",
	"request_id": null
}

Response Data

{
	"setup_wizard_failure_message": "Failed to update global settings",
	"exception": "ModuleNotFoundError: No module named 'frappe.utils.modules'",
	"exc_type": "ModuleNotFoundError",
	"_exc_source": "crm (app)"
}

You just need to replace

 from frappe.utils import get_modules_from_all_apps_for_user

with

 from frappe.config import get_modules_from_all_apps_for_user

in
frappe-bench/apps/crm/crm/api/init.py