fix: Add a patch to set is_system_generated flag

This commit is contained in:
Suraj Shetty 2022-03-17 12:49:35 +05:30
parent c51a581e2c
commit 191803e15f
2 changed files with 18 additions and 0 deletions

View file

@ -196,3 +196,4 @@ frappe.patches.v14_0.copy_mail_data #08.03.21
frappe.patches.v14_0.update_github_endpoints #08-11-2021
frappe.patches.v14_0.remove_db_aggregation
frappe.patches.v14_0.update_color_names_in_kanban_board_column
frappe.patches.v14_0.update_is_system_generated_flag

View file

@ -0,0 +1,17 @@
import frappe
def execute():
# assuming all customization generated by Admin is system generated customization
custom_field = frappe.qb.DocType("Custom Field")
(
frappe.qb.update(custom_field)
.set(custom_field.is_system_generated, True)
.where(custom_field.owner == 'Administrator').run()
)
property_setter = frappe.qb.DocType("Property Setter")
(
frappe.qb.update(property_setter)
.set(property_setter.is_system_generated, True)
.where(property_setter.owner == 'Administrator').run()
)