diff --git a/patches/november_2012/__init__.py b/patches/november_2012/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/patches/november_2012/custom_field_insert_after.py b/patches/november_2012/custom_field_insert_after.py new file mode 100644 index 0000000000..6824e7a5e1 --- /dev/null +++ b/patches/november_2012/custom_field_insert_after.py @@ -0,0 +1,12 @@ +import webnotes + +def execute(): + import re + regex = re.compile("\s-\s[\d\.]*") + + for name, insert_after in webnotes.conn.sql("""select name, insert_after + from `tabCustom Field`"""): + if insert_after: + new_insert_after = regex.sub("", insert_after) + webnotes.conn.set_value("Custom Field", name, "insert_after", new_insert_after) + \ No newline at end of file diff --git a/patches/patch_list.py b/patches/patch_list.py index 8194b86f69..87019150c6 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -642,5 +642,9 @@ patch_list = [ { 'patch_module': 'patches.october_2012', 'patch_file': 'custom_script_delete_permission', - } + }, + { + 'patch_module': 'patches.november_2012', + 'patch_file': 'custom_field_insert_after', + }, ]