fix: Remove the Autocomplete cache feature by Shankarv19bcr [frappe] PR#23888 [backport/v4]
Backport of !1328 (merged)
Conflicts detected for source commit: 9718d92eaf84b4fee47a6ebd8466d6ca38f8f423
diff --cc frappe/commands/site.py
index cea02b4321,e049babfa9..0000000000
--- a/frappe/commands/site.py
+++ b/frappe/commands/site.py
@@@ -572,7 -572,7 +572,11 @@@ def describe_database_table(context, do
def _extract_table_stats(doctype: str, columns: list[str]) -> dict:
++<<<<<<< HEAD
+ from frappe.utils import cstr, get_table_name
++=======
+ from frappe.utils import cint, cstr, get_table_name
++>>>>>>> 9718d92eaf84b4fee47a6ebd8466d6ca38f8f423
def sql_bool(val):
return cstr(val).lower() in ("yes", "1", "true")
@@@ -612,7 -612,13 +616,17 @@@
if idx["Seq_in_index"] == 1:
update_cardinality(idx["Column_name"], idx["Cardinality"])
++<<<<<<< HEAD
+ total_rows = frappe.db.count(doctype)
++=======
+ total_rows = cint(
+ frappe.db.sql(
+ f"""select table_rows
+ from information_schema.tables
+ where table_name = 'tab{doctype}'"""
+ )[0][0]
+ )
++>>>>>>> 9718d92eaf84b4fee47a6ebd8466d6ca38f8f423
# fetch accurate cardinality for columns by query. WARN: This can take a lot of time.
for column in columns:
diff --cc frappe/public/js/frappe/form/grid_row.js
index 8a90a731e9,bbd9040872..0000000000
--- a/frappe/public/js/frappe/form/grid_row.js
+++ b/frappe/public/js/frappe/form/grid_row.js
@@@ -1130,8 -1130,8 +1130,13 @@@ export default class GridRow
let ignore_fieldtypes = ["Text", "Small Text", "Code", "Text Editor", "HTML Editor"];
if (field.$input) {
field.$input.on("keydown", function (e) {
++<<<<<<< HEAD
+ var { TAB, UP: UP_ARROW, DOWN: DOWN_ARROW } = frappe.ui.keyCode;
+ if (![TAB, UP_ARROW, DOWN_ARROW].includes(e.which)) {
++=======
+ var { ESCAPE, TAB, UP: UP_ARROW, DOWN: DOWN_ARROW } = frappe.ui.keyCode;
+ if (![TAB, UP_ARROW, DOWN_ARROW, ESCAPE].includes(e.which)) {
++>>>>>>> 9718d92eaf84b4fee47a6ebd8466d6ca38f8f423
return;
}
diff --cc frappe/utils/data.py
index e3d892aa88,4df1a6cc51..0000000000
--- a/frappe/utils/data.py
+++ b/frappe/utils/data.py
@@@ -638,14 -638,14 +638,26 @@@ def get_quarter_ending
return date.strftime(DATE_FORMAT) if as_str else date
++<<<<<<< HEAD
++=======
@typing.overload
def get_year_ending(
dt: DateTimeLikeObject | None = None, as_str: Literal[False] = False
) -> datetime.date:
...
++>>>>>>> 9718d92eaf84b4fee47a6ebd8466d6ca38f8f423
++@typing.overload
++def get_year_ending(
++ dt: DateTimeLikeObject | None = None, as_str: Literal[False] = False
++) -> datetime.date:
++ ...
++
++<<<<<<< HEAD
++=======
++>>>>>>> 9718d92eaf84b4fee47a6ebd8466d6ca38f8f423
@typing.overload
def get_year_ending(dt: DateTimeLikeObject | None = None, as_str: Literal[True] = False) -> str:
...
@@@ -662,12 -662,12 +674,21 @@@ def get_year_ending(date: DateTimeLikeO
year_ending = add_to_date(next_year_start, days=-1)
return year_ending.strftime(DATE_FORMAT) if as_str else year_ending
++<<<<<<< HEAD
+
+def get_time(
+ time_str: str | datetime.datetime | datetime.time | datetime.timedelta,
+) -> datetime.time:
+ """Return a `datetime.time` object for the given `time_str`.
+
++=======
+
+ def get_time(
+ time_str: str | datetime.datetime | datetime.time | datetime.timedelta,
+ ) -> datetime.time:
+ """Return a `datetime.time` object for the given `time_str`.
+
++>>>>>>> 9718d92eaf84b4fee47a6ebd8466d6ca38f8f423
If the given argument is already a `datetime.time` object, it is returned as is."""
if isinstance(time_str, datetime.datetime):
diff --cc frappe/website/doctype/top_bar_item/top_bar_item.json
index f0ff79f1c9,a20624cba6..0000000000
--- a/frappe/website/doctype/top_bar_item/top_bar_item.json
+++ b/frappe/website/doctype/top_bar_item/top_bar_item.json
@@@ -12,8 -12,7 +12,12 @@@
"right",
"login_required",
"column_break_5",
++<<<<<<< HEAD
+ "parent_label",
+ "icon"
++=======
+ "parent_label"
++>>>>>>> 9718d92eaf84b4fee47a6ebd8466d6ca38f8f423
],
"fields": [
{
@@@ -52,12 -51,6 +56,15 @@@
"fieldtype": "Column Break"
},
{
++<<<<<<< HEAD
+ "description": "If Icon is set, it will be shown instead of Label",
+ "fieldname": "icon",
+ "fieldtype": "Attach Image",
+ "label": "Icon"
+ },
+ {
++=======
++>>>>>>> 9718d92eaf84b4fee47a6ebd8466d6ca38f8f423
"default": "0",
"depends_on": "eval:doc.url",
"fieldname": "open_in_new_tab",
@@@ -75,7 -68,7 +82,11 @@@
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
++<<<<<<< HEAD
+ "modified": "2023-12-29 09:00:36.535080",
++=======
+ "modified": "2024-01-08 12:05:25.782635",
++>>>>>>> 9718d92eaf84b4fee47a6ebd8466d6ca38f8f423
"modified_by": "Administrator",
"module": "Website",
"name": "Top Bar Item",
@@@ -84,4 -77,4 +95,8 @@@
"sort_field": "modified",
"sort_order": "ASC",
"states": []
- }
++<<<<<<< HEAD
++}
++=======
+ }
++>>>>>>> 9718d92eaf84b4fee47a6ebd8466d6ca38f8f423
diff --cc frappe/website/doctype/website_settings/website_settings.json
index e06da9203a,a4d7050b73..0000000000
--- a/frappe/website/doctype/website_settings/website_settings.json
+++ b/frappe/website/doctype/website_settings/website_settings.json
@@@ -488,7 -495,7 +495,11 @@@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
++<<<<<<< HEAD
+ "modified": "2023-12-08 15:52:37.525003",
++=======
+ "modified": "2024-01-08 11:50:34.750809",
++>>>>>>> 9718d92eaf84b4fee47a6ebd8466d6ca38f8f423
"modified_by": "Administrator",
"module": "Website",
"name": "Website Settings",
diff --cc frappe/website/doctype/website_settings/website_settings.py
index 251f1fb14f,742e3d324d..0000000000
--- a/frappe/website/doctype/website_settings/website_settings.py
+++ b/frappe/website/doctype/website_settings/website_settings.py
@@@ -208,7 -208,9 +208,13 @@@ def get_website_settings(context=None)
settings: "WebsiteSettings" = frappe.get_cached_doc("Website Settings")
is_logged_in = frappe.session.user != "Guest"
++<<<<<<< HEAD
+ top_bar_items = [item for item in settings.top_bar_items if not (cint(item.login_required) and not is_logged_in)]
++=======
+ top_bar_items = [
+ item for item in settings.top_bar_items if not (cint(item.login_required) and not is_logged_in)
+ ]
++>>>>>>> 9718d92eaf84b4fee47a6ebd8466d6ca38f8f423
context = context.update(
{
diff --cc package.json
index c14dd86b8e,5c092e69ae..0000000000
--- a/package.json
+++ b/package.json
@@@ -65,7 -65,7 +65,11 @@@
"fast-deep-equal": "^2.0.1",
"fast-glob": "^3.2.5",
"frappe-charts": "2.0.0-rc22",
++<<<<<<< HEAD
+ "frappe-datatable": "^1.17.13",
++=======
+ "frappe-datatable": "^1.17.14",
++>>>>>>> 9718d92eaf84b4fee47a6ebd8466d6ca38f8f423
"frappe-gantt": "^0.6.0",
"highlight.js": "^10.4.1",
"html5-qrcode": "^2.3.8",
diff --cc yarn.lock
index e951d7b58f,0e55648a40..0000000000
--- a/yarn.lock
+++ b/yarn.lock
@@@ -1802,10 -1802,10 +1802,17 @@@ frappe-charts@2.0.0-rc22
resolved "https://registry.yarnpkg.com/frappe-charts/-/frappe-charts-2.0.0-rc22.tgz#9a5a747febdc381a1d4d7af96e89cf519dfba8c0"
integrity sha512-N7f/8979wJCKjusOinaUYfMxB80YnfuVLrSkjpj4LtyqS0BGS6SuJxUnb7Jl4RWUFEIs7zEhideIKnyLeFZF4Q==
++<<<<<<< HEAD
+frappe-datatable@1.17.13:
+ version "1.17.13"
+ resolved "https://registry.yarnpkg.com/frappe-datatable/-/frappe-datatable-1.17.13.tgz#349a15fd102b8abe55ab903c65de074aa66a26d6"
+ integrity sha512-rHzLjuAbWdbqEZbU6RCcimyeTswdIKtl8WJLjctj5zze7w5DFSQX0iDTbKNBG7TehS7YqP4k+ySIhvkHRELq3w==
++=======
+ frappe-datatable@1.17.14:
+ version "1.17.14"
+ resolved "https://registry.yarnpkg.com/frappe-datatable/-/frappe-datatable-1.17.14.tgz#5fe99fa45089d6f2a54d13215608ef777bc947ec"
+ integrity sha512-rrUyk+8ueX9ADDXwaHobBGmAWK86lF3P3yc3KYGHyhNiNTwKpUW08zQeuTUzJnWv0OSZ/zXYePzrjFKG7ZR4Wg==
++>>>>>>> 9718d92eaf84b4fee47a6ebd8466d6ca38f8f423
dependencies:
hyperlist "^1.0.0-beta"
lodash "^4.17.5"