From 6147451da3821a6d4aaeab0dc69e805256f77cb4 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Sat, 4 Feb 2012 09:53:25 +0530 Subject: [PATCH] refactored patches, bug fix for assign_to --- .../patches/jan_mar_2012/latest/cleanups.py | 33 +++++++++++++++++++ erpnext/patches/jan_mar_2012/latest/login.py | 21 ------------ .../patches/jan_mar_2012/latest/website.py | 15 --------- version.num | 2 +- 4 files changed, 34 insertions(+), 37 deletions(-) create mode 100644 erpnext/patches/jan_mar_2012/latest/cleanups.py diff --git a/erpnext/patches/jan_mar_2012/latest/cleanups.py b/erpnext/patches/jan_mar_2012/latest/cleanups.py new file mode 100644 index 0000000000..44d24c034b --- /dev/null +++ b/erpnext/patches/jan_mar_2012/latest/cleanups.py @@ -0,0 +1,33 @@ +import webnotes + +def execute(): + from webnotes.model import delete_doc + delete_doc("DocType", "SSO Control") + delete_doc("DocType", "WN ERP Client Control") + delete_doc("DocType", "Production Tips Common") + delete_doc("DocType", "DocTrigger") + delete_doc("Page", "Setup Wizard") + + # cleanup control panel + delete_doc("DocType", "Control Panel") + reload_doc("core", "doctype", "control_panel") + + # cleanup page + delete_doc("DocType", "Page") + reload_doc("core", "doctype", "page") + + webnotes.conn.sql("""delete from tabSingles + where field like 'startup_%' and doctype='Control Panel'""") + + webnotes.conn.commit() + + # DDLs + # ------------------- + + webnotes.conn.sql("drop table if exists tabDocTrigger") + + try: webnotes.conn.sql("""alter table `tabFile Data` drop column blob_content""") + except: pass + + webnotes.conn.sql("""alter table __PatchLog engine=InnoDB""") + \ No newline at end of file diff --git a/erpnext/patches/jan_mar_2012/latest/login.py b/erpnext/patches/jan_mar_2012/latest/login.py index fcf72dc0e4..97cd323d6a 100644 --- a/erpnext/patches/jan_mar_2012/latest/login.py +++ b/erpnext/patches/jan_mar_2012/latest/login.py @@ -5,28 +5,7 @@ from webnotes.modules import reload_doc def execute(): add_default_home_page() reload_doc('setup','doctype','manage_account') - webnotes.conn.commit() - webnotes.conn.sql("drop table if exists tabDocTrigger") - cleanup() - -def cleanup(): - webnotes.conn.begin() - from webnotes.model import delete_doc - delete_doc("DocType", "SSO Control") - delete_doc("DocType", "WN ERP Client Control") - delete_doc("DocType", "Production Tips Common") - delete_doc("DocType", "DocTrigger") - # cleanup control panel - delete_doc("DocType", "Control Panel") - reload_doc("core", "doctype", "control_panel") - - # cleanup page - delete_doc("DocType", "Page") - reload_doc("core", "doctype", "page") - - webnotes.conn.sql("""delete from tabSingles - where field like 'startup_%' and doctype='Control Panel'""") def add_default_home_page(): if not webnotes.conn.sql("""select name from `tabDefault Home Page` diff --git a/erpnext/patches/jan_mar_2012/latest/website.py b/erpnext/patches/jan_mar_2012/latest/website.py index 1b4754aef5..a6f1310ee0 100644 --- a/erpnext/patches/jan_mar_2012/latest/website.py +++ b/erpnext/patches/jan_mar_2012/latest/website.py @@ -5,8 +5,6 @@ from webnotes.model.doc import Document def execute(): add_website_manager() - cleanup_file_data() - update_patch_log() from webnotes.modules import reload_doc from webnotes.model import delete_doc @@ -50,16 +48,3 @@ def add_website_manager(): d.parent = i[0] d.role = 'Website Manager' d.save(1) - -def cleanup_file_data(): - webnotes.conn.commit() - try: - webnotes.conn.sql("""alter table `tabFile Data` drop column blob_content""") - except: - pass - webnotes.conn.begin() - -def update_patch_log(): - webnotes.conn.commit() - webnotes.conn.sql("""alter table __PatchLog engine=InnoDB""") - webnotes.conn.begin() diff --git a/version.num b/version.num index 2a9c18ad50..b0e9f8d0ff 100644 --- a/version.num +++ b/version.num @@ -1 +1 @@ -357 \ No newline at end of file +358 \ No newline at end of file