fix: add patch to add standard field

This commit is contained in:
sokumon 2026-01-08 19:02:19 +05:30
parent b896c0f611
commit 7a8a729bcb
2 changed files with 13 additions and 0 deletions

View file

@ -253,3 +253,4 @@ frappe.patches.v16_0.add_private_workspaces_to_sidebar
frappe.core.doctype.communication_link.patches.copy_communication_date_to_link
frappe.core.doctype.communication.patches.drop_ref_dt_dn_index
frappe.patches.v16_0.change_link_type_to_workspace_sidebar
frappe.patches.v16_0.add_standard_field_in_workspace_sidebar

View file

@ -0,0 +1,12 @@
import frappe
from frappe.model.sync import check_if_record_exists
def execute():
for sidebar in frappe.get_all("Workspace Sidebar", pluck="name"):
sidebar_doc = frappe.get_doc("Workspace Sidebar", sidebar)
if sidebar_doc.app and check_if_record_exists(
"app", frappe.get_app_path(sidebar_doc.app), "Workspace Sidebar", sidebar_doc.name
):
sidebar_doc.standard = 1
sidebar_doc.save()