Skip to content

Commit

Permalink
fix: fix patch to pluralize list view setting
Browse files Browse the repository at this point in the history
  • Loading branch information
hasnain2808 committed Apr 1, 2021
1 parent b279ca2 commit 872151f
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

def execute():
if frappe.db.table_exists('List View Setting'):
if not frappe.db.table_exists('List View Settings'):
frappe.reload_doctype("List View Settings")

existing_list_view_settings = frappe.get_all('List View Settings', as_list=True)
for list_view_setting in frappe.get_all('List View Setting', fields = ['disable_count', 'disable_sidebar_stats', 'disable_auto_refresh', 'name']):
name = list_view_setting.pop('name')
Expand All @@ -16,5 +19,6 @@ def execute():
# setting name here is necessary because autoname is set as prompt
list_view_settings.name = name
list_view_settings.insert()

frappe.delete_doc("DocType", "List View Setting", force=True)
frappe.db.commit()

0 comments on commit 872151f

Please sign in to comment.