From 09cbf49ff1424f0d23cb18fdb240d87a79f938ff Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 8 May 2018 15:12:00 +0530 Subject: [PATCH] Increase the length of Singles table columns (#5540) --- .../role_permission_for_page_and_report.py | 9 +++++---- frappe/patches.txt | 3 ++- .../patches/v10_0/increase_single_table_column_length.py | 8 ++++++++ 3 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 frappe/patches/v10_0/increase_single_table_column_length.py diff --git a/frappe/core/doctype/role_permission_for_page_and_report/role_permission_for_page_and_report.py b/frappe/core/doctype/role_permission_for_page_and_report/role_permission_for_page_and_report.py index 4df27b9b10..f05e187972 100644 --- a/frappe/core/doctype/role_permission_for_page_and_report/role_permission_for_page_and_report.py +++ b/frappe/core/doctype/role_permission_for_page_and_report/role_permission_for_page_and_report.py @@ -61,10 +61,11 @@ class RolePermissionforPageandReport(Document): def get_roles(self): roles = [] for data in self.roles: - roles.append({ - 'role': data.role, - 'parenttype': 'Custom Role' - }) + if data.role != "All": + roles.append({ + 'role': data.role, + 'parenttype': 'Custom Role' + }) return roles def update_status(self): diff --git a/frappe/patches.txt b/frappe/patches.txt index 02c235d132..d57b103aad 100644 --- a/frappe/patches.txt +++ b/frappe/patches.txt @@ -200,4 +200,5 @@ frappe.patches.v9_1.resave_domain_settings frappe.patches.v9_1.revert_domain_settings frappe.patches.v9_1.move_feed_to_activity_log execute:frappe.delete_doc('Page', 'data-import-tool', ignore_missing=True) -frappe.patches.v10_0.reload_countries_and_currencies \ No newline at end of file +frappe.patches.v10_0.reload_countries_and_currencies +frappe.patches.v10_0.increase_single_table_column_length \ No newline at end of file diff --git a/frappe/patches/v10_0/increase_single_table_column_length.py b/frappe/patches/v10_0/increase_single_table_column_length.py new file mode 100644 index 0000000000..3c2a2b3233 --- /dev/null +++ b/frappe/patches/v10_0/increase_single_table_column_length.py @@ -0,0 +1,8 @@ +""" +Run this after updating country_info.json and or +""" +import frappe + +def execute(): + for col in ("field", "doctype"): + frappe.db.sql_ddl("alter table `tabSingles` modify column `{0}` varchar(255)".format(col))