We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Route History shouldn‘t be editable
Editing or adding a new Route History:

![IMG_2238](https://github.com/frappe/frappe/assets/46800703/caf5ccf6-80c0-4d66-8ed8-1716eaf27f52)
![IMG_2240](https://github.com/frappe/frappe/assets/46800703/ff1d1ae5-f657-4607-a27e-e390096b5144)

… shouldn’t be possible, not even for the Administrator.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `frappe/desk/doctype/route_history/route_history.py`
Content:
```
1 # Copyright (c) 2022, Frappe Technologies and contributors
2 # License: MIT. See LICENSE
3 
4 import frappe
5 from frappe.deferred_insert import deferred_insert as _deferred_insert
6 from frappe.model.document import Document
7 
8 
9 class RouteHistory(Document):
10 	# begin: auto-generated types
11 	# This code is auto-generated. Do not modify anything in this block.
12 
13 	from typing import TYPE_CHECKING
14 
15 	if TYPE_CHECKING:
16 		from frappe.types import DF
17 
18 		route: DF.Data | None
19 		user: DF.Link | None
20 	# end: auto-generated types
21 	@staticmethod
22 	def clear_old_logs(days=30):
23 		from frappe.query_builder import Interval
24 		from frappe.query_builder.functions import Now
25 
26 		table = frappe.qb.DocType("Route History")
27 		frappe.db.delete(table, filters=(table.modified < (Now() - Interval(days=days))))
28 
29 
30 @frappe.whitelist()
31 def deferred_insert(routes):
32 	routes = [
33 		{
34 			"user": frappe.session.user,
35 			"route": route.get("route"),
36 			"creation": route.get("creation"),
37 		}
38 		for route in frappe.parse_json(routes)
39 	]
40 
41 	_deferred_insert("Route History", routes)
42 
43 
44 @frappe.whitelist()
45 def frequently_visited_links():
46 	return frappe.get_all(
47 		"Route History",
48 		fields=["route", "count(name) as count"],
49 		filters={"user": frappe.session.user},
50 		group_by="route",
51 		order_by="count desc",
52 		limit=5,
53 	)
54
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/frappe/desk/doctype/route_history/route_history.py b/frappe/desk/doctype/route_history/route_history.py
--- a/frappe/desk/doctype/route_history/route_history.py
+++ b/frappe/desk/doctype/route_history/route_history.py
@@ -18,6 +18,7 @@
 		route: DF.Data | None
 		user: DF.Link | None
 	# end: auto-generated types
+
 	@staticmethod
 	def clear_old_logs(days=30):
 		from frappe.query_builder import Interval

{"golden_diff": "diff --git a/frappe/desk/doctype/route_history/route_history.py b/frappe/desk/doctype/route_history/route_history.py\n--- a/frappe/desk/doctype/route_history/route_history.py\n+++ b/frappe/desk/doctype/route_history/route_history.py\n@@ -18,6 +18,7 @@\n \t\troute: DF.Data | None\n \t\tuser: DF.Link | None\n \t# end: auto-generated types\n+\n \t@staticmethod\n \tdef clear_old_logs(days=30):\n \t\tfrom frappe.query_builder import Interval\n", "issue": "Route History shouldn\u2018t be editable\nEditing or adding a new Route History:\r\n\r\n![IMG_2238](https://github.com/frappe/frappe/assets/46800703/caf5ccf6-80c0-4d66-8ed8-1716eaf27f52)\r\n![IMG_2240](https://github.com/frappe/frappe/assets/46800703/ff1d1ae5-f657-4607-a27e-e390096b5144)\r\n\r\n\u2026 shouldn\u2019t be possible, not even for the Administrator.\n", "before_files": [{"content": "# Copyright (c) 2022, Frappe Technologies and contributors\n# License: MIT. See LICENSE\n\nimport frappe\nfrom frappe.deferred_insert import deferred_insert as _deferred_insert\nfrom frappe.model.document import Document\n\n\nclass RouteHistory(Document):\n\t# begin: auto-generated types\n\t# This code is auto-generated. Do not modify anything in this block.\n\n\tfrom typing import TYPE_CHECKING\n\n\tif TYPE_CHECKING:\n\t\tfrom frappe.types import DF\n\n\t\troute: DF.Data | None\n\t\tuser: DF.Link | None\n\t# end: auto-generated types\n\t@staticmethod\n\tdef clear_old_logs(days=30):\n\t\tfrom frappe.query_builder import Interval\n\t\tfrom frappe.query_builder.functions import Now\n\n\t\ttable = frappe.qb.DocType(\"Route History\")\n\t\tfrappe.db.delete(table, filters=(table.modified < (Now() - Interval(days=days))))\n\n\n@frappe.whitelist()\ndef deferred_insert(routes):\n\troutes = [\n\t\t{\n\t\t\t\"user\": frappe.session.user,\n\t\t\t\"route\": route.get(\"route\"),\n\t\t\t\"creation\": route.get(\"creation\"),\n\t\t}\n\t\tfor route in frappe.parse_json(routes)\n\t]\n\n\t_deferred_insert(\"Route History\", routes)\n\n\n@frappe.whitelist()\ndef frequently_visited_links():\n\treturn frappe.get_all(\n\t\t\"Route History\",\n\t\tfields=[\"route\", \"count(name) as count\"],\n\t\tfilters={\"user\": frappe.session.user},\n\t\tgroup_by=\"route\",\n\t\torder_by=\"count desc\",\n\t\tlimit=5,\n\t)\n", "path": "frappe/desk/doctype/route_history/route_history.py"}], "after_files": [{"content": "# Copyright (c) 2022, Frappe Technologies and contributors\n# License: MIT. See LICENSE\n\nimport frappe\nfrom frappe.deferred_insert import deferred_insert as _deferred_insert\nfrom frappe.model.document import Document\n\n\nclass RouteHistory(Document):\n\t# begin: auto-generated types\n\t# This code is auto-generated. Do not modify anything in this block.\n\n\tfrom typing import TYPE_CHECKING\n\n\tif TYPE_CHECKING:\n\t\tfrom frappe.types import DF\n\n\t\troute: DF.Data | None\n\t\tuser: DF.Link | None\n\t# end: auto-generated types\n\n\t@staticmethod\n\tdef clear_old_logs(days=30):\n\t\tfrom frappe.query_builder import Interval\n\t\tfrom frappe.query_builder.functions import Now\n\n\t\ttable = frappe.qb.DocType(\"Route History\")\n\t\tfrappe.db.delete(table, filters=(table.modified < (Now() - Interval(days=days))))\n\n\n@frappe.whitelist()\ndef deferred_insert(routes):\n\troutes = [\n\t\t{\n\t\t\t\"user\": frappe.session.user,\n\t\t\t\"route\": route.get(\"route\"),\n\t\t\t\"creation\": route.get(\"creation\"),\n\t\t}\n\t\tfor route in frappe.parse_json(routes)\n\t]\n\n\t_deferred_insert(\"Route History\", routes)\n\n\n@frappe.whitelist()\ndef frequently_visited_links():\n\treturn frappe.get_all(\n\t\t\"Route History\",\n\t\tfields=[\"route\", \"count(name) as count\"],\n\t\tfilters={\"user\": frappe.session.user},\n\t\tgroup_by=\"route\",\n\t\torder_by=\"count desc\",\n\t\tlimit=5,\n\t)\n", "path": "frappe/desk/doctype/route_history/route_history.py"}]}