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"


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


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/", line 69, in application
    response = frappe.api.handle()
  File "apps/frappe/frappe/", line 54, in handle
    return frappe.handler.handle()
  File "apps/frappe/frappe/", line 45, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/", line 83, in execute_cmd
    return, **frappe.form_dict)
  File "apps/frappe/frappe/", line 1607, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/desk/form/", line 38, in getdoc
  File "apps/frappe/frappe/desk/form/", line 370, in run_onload
  File "apps/frappe/frappe/model/", line 909, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "apps/frappe/frappe/model/", line 1259, in composer
    return composed(self, method, *args, **kwargs)
  File "apps/frappe/frappe/model/", line 1241, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "apps/frappe/frappe/model/", line 906, in fn
    return method_object(*args, **kwargs)
  File "apps/erpnext/erpnext/selling/doctype/customer/", line 36, in onload
  File "apps/erpnext/erpnext/selling/doctype/customer/", line 39, in load_dashboard_info
    info = get_dashboard_info(self.doctype,, self.loyalty_program)
  File "apps/erpnext/erpnext/accounts/", line 756, in get_dashboard_info
    company_wise_grand_total = frappe.get_all(
  File "apps/frappe/frappe/", line 1924, in get_all
    return get_list(doctype, *args, **kwargs)
  File "apps/frappe/frappe/", line 1896, in get_list
    return frappe.model.db_query.DatabaseQuery(doctype).execute(*args, **kwargs)
  File "apps/frappe/frappe/model/", line 172, in execute
    result = self.build_and_run()
  File "apps/frappe/frappe/model/", line 212, in build_and_run
    return frappe.db.sql(
  File "apps/frappe/frappe/database/postgres/", line 199, in sql
    return super().sql(modify_query(query), modify_values(values), *args, **kwargs)
  File "apps/frappe/frappe/database/", 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.