From 8a61c7489f5542c8a7005b7937cfeb62fe526658 Mon Sep 17 00:00:00 2001 From: Shariq Ansari <30859809+shariquerik@users.noreply.github.com> Date: Sat, 14 May 2022 12:59:54 +0530 Subject: [PATCH] fix(patch): Reload workspace child tables in pre_model_sync (#16897) * chore: used better db API arguments Co-authored-by: gavin --- frappe/patches.txt | 1 + .../patches/v14_0/reload_workspace_child_tables.py | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 frappe/patches/v14_0/reload_workspace_child_tables.py diff --git a/frappe/patches.txt b/frappe/patches.txt index 80f4e382e3..4dc8c1b698 100644 --- a/frappe/patches.txt +++ b/frappe/patches.txt @@ -190,6 +190,7 @@ frappe.patches.v14_0.transform_todo_schema frappe.patches.v14_0.remove_post_and_post_comment frappe.patches.v14_0.reset_creation_datetime frappe.patches.v14_0.remove_is_first_startup +frappe.patches.v14_0.reload_workspace_child_tables [post_model_sync] frappe.patches.v14_0.drop_data_import_legacy diff --git a/frappe/patches/v14_0/reload_workspace_child_tables.py b/frappe/patches/v14_0/reload_workspace_child_tables.py new file mode 100644 index 0000000000..c22774d94c --- /dev/null +++ b/frappe/patches/v14_0/reload_workspace_child_tables.py @@ -0,0 +1,13 @@ +import frappe + + +def execute(): + child_tables = frappe.get_all( + "DocField", + pluck="options", + filters={"fieldtype": ["in", frappe.model.table_fields], "parent": "Workspace"}, + ) + + for child_table in child_tables: + if child_table != "Has Role": + frappe.reload_doc("desk", "doctype", child_table, force=True)