diff --git a/erpnext/patches/may_2012/page_role_series_fix.py b/erpnext/patches/may_2012/page_role_series_fix.py new file mode 100644 index 0000000000..5e66ac3b79 --- /dev/null +++ b/erpnext/patches/may_2012/page_role_series_fix.py @@ -0,0 +1,5 @@ +def execute(): + import webnotes + sr = webnotes.conn.sql("select max(name) from `tabPage Role`") + if sr and sr[0][0].startswith('PR'): + sql("update tabSeries set current = %s where name = 'PR'", int(sr[0][0][2:])) diff --git a/erpnext/patches/patch_list.py b/erpnext/patches/patch_list.py index ea4840a55a..6f2f8cefd5 100644 --- a/erpnext/patches/patch_list.py +++ b/erpnext/patches/patch_list.py @@ -342,5 +342,10 @@ patch_list = [ 'patch_file': 'reload_reports', 'description': 'reload reports: itemwise sales/delivery details' }, + { + 'patch_module': 'patches.may_2012', + 'patch_file': 'page_role_series_fix', + 'description': 'reset series of page role at max' + }, ]