From 41526227e33a0985fe5b4a98f319cf4640a832ab Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 11 May 2012 11:11:46 +0530 Subject: [PATCH] page role series pacth --- erpnext/patches/may_2012/page_role_series_fix.py | 5 +++++ erpnext/patches/patch_list.py | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 erpnext/patches/may_2012/page_role_series_fix.py 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 00000000000..5e66ac3b795 --- /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 ea4840a55ab..6f2f8cefd5a 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' + }, ]