fix(patch): Reload workspace child tables in pre_model_sync (#16897)

* chore: used better db API arguments

Co-authored-by: gavin <gavin18d@gmail.com>
This commit is contained in:
Shariq Ansari 2022-05-14 12:59:54 +05:30 committed by GitHub
parent 26b54221ea
commit 8a61c7489f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View file

@ -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

View file

@ -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)