refactor: merge two workspace2.0 patches

This commit is contained in:
Ankush Menat 2022-06-29 15:36:18 +05:30
parent 61c958c9bb
commit 3ec6f7f470
3 changed files with 10 additions and 15 deletions

View file

@ -184,14 +184,12 @@ frappe.patches.v13_0.jinja_hook
frappe.patches.v13_0.update_notification_channel_if_empty
frappe.patches.v13_0.set_first_day_of_the_week
execute:frappe.reload_doc('custom', 'doctype', 'custom_field')
execute:frappe.reload_doc('desk', 'doctype', 'workspace_quick_list')
frappe.patches.v14_0.update_workspace2 # 20.09.2021
frappe.patches.v14_0.save_ratings_in_fraction #23-12-2021
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
frappe.patches.v14_0.clear_long_pending_stale_logs
frappe.patches.v14_0.log_settings_migration

View file

@ -1,13 +0,0 @@
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)

View file

@ -7,6 +7,16 @@ from frappe import _
def execute():
frappe.reload_doc("desk", "doctype", "workspace", force=True)
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)
for seq, workspace in enumerate(frappe.get_all("Workspace", order_by="name asc")):
doc = frappe.get_doc("Workspace", workspace.name)
content = create_content(doc)