How to solve Customer/Employee details info bug

I have a problem with the customer/employee details info
when I’m trying to get any customer/employee details info I have faced this error message:

App Versions

{
	"erpnext": "14.15.1",
	"frappe": "14.25.1"
}

Route

Form/Customer/مركز السلوفاكي

Trackeback

Syntax error in query:
select "company", sum(grand_total) as grand_total, sum(base_grand_total) as base_grand_total, MAX(docstatus, tabSales Invoice) as "tabSales Invoice.docstatus, tabSales Invoice.modified"
			from "tabSales Invoice"
			where "tabSales Invoice"."docstatus" = '1' and "tabSales Invoice"."customer" = 'مركز السلوفاكي' and coalesce("tabSales Invoice"."posting_date", '0001-01-01 00:00:00.000000') between '2023-01-01' AND '2023-12-31'
			 group by company
			 order by "tabSales Invoice".docstatus asc, "tabSales Invoice"."modified" DESC None
Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 69, in application
    response = frappe.api.handle()
  File "apps/frappe/frappe/api.py", line 54, in handle
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 45, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 83, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1607, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/desk/form/load.py", line 38, in getdoc
    run_onload(doc)
  File "apps/frappe/frappe/desk/form/load.py", line 370, in run_onload
    doc.run_method("onload")
  File "apps/frappe/frappe/model/document.py", line 909, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1259, in composer
    return composed(self, method, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1241, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "apps/frappe/frappe/model/document.py", line 906, in fn
    return method_object(*args, **kwargs)
  File "apps/erpnext/erpnext/selling/doctype/customer/customer.py", line 36, in onload
    self.load_dashboard_info()
  File "apps/erpnext/erpnext/selling/doctype/customer/customer.py", line 39, in load_dashboard_info
    info = get_dashboard_info(self.doctype, self.name, self.loyalty_program)
  File "apps/erpnext/erpnext/accounts/party.py", line 756, in get_dashboard_info
    company_wise_grand_total = frappe.get_all(
  File "apps/frappe/frappe/__init__.py", line 1924, in get_all
    return get_list(doctype, *args, **kwargs)
  File "apps/frappe/frappe/__init__.py", line 1896, in get_list
    return frappe.model.db_query.DatabaseQuery(doctype).execute(*args, **kwargs)
  File "apps/frappe/frappe/model/db_query.py", line 172, in execute
    result = self.build_and_run()
  File "apps/frappe/frappe/model/db_query.py", line 212, in build_and_run
    return frappe.db.sql(
  File "apps/frappe/frappe/database/postgres/database.py", line 199, in sql
    return super().sql(modify_query(query), modify_values(values), *args, **kwargs)
  File "apps/frappe/frappe/database/database.py", line 218, in sql
    self._cursor.execute(query, values)
psycopg2.errors.SyntaxError: syntax error at or near "Invoice"
LINE 1: ...tal) as base_grand_total, MAX(docstatus, tabSales Invoice) a...
                                                             ^


Request Data

{
	"type": "GET",
	"args": {
		"doctype": "Customer",
		"name": "مركز السلوفاكي"
	},
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/frappe.desk.form.load.getdoc"
}

Response Data

{
	"exception": ""
}

Thanks in advance.