diff --git a/erpnext/patches/jan_mar_2012/website/__init__.py b/erpnext/patches/jan_mar_2012/website/__init__.py index e69de29bb2..680c79a18e 100644 --- a/erpnext/patches/jan_mar_2012/website/__init__.py +++ b/erpnext/patches/jan_mar_2012/website/__init__.py @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/erpnext/patches/jan_mar_2012/website/all.py b/erpnext/patches/jan_mar_2012/website/all.py new file mode 100644 index 0000000000..03b79775e1 --- /dev/null +++ b/erpnext/patches/jan_mar_2012/website/all.py @@ -0,0 +1,10 @@ +import patches.jan_mar_2012.website.login +import patches.jan_mar_2012.website.feed +import patches.jan_mar_2012.website.website +import patches.jan_mar_2012.website.cleanups + +def execute(): + patches.jan_mar_2012.website.login.execute() + patches.jan_mar_2012.website.feed.execute() + patches.jan_mar_2012.website.website.execute() + patches.jan_mar_2012.website.cleanups.execute() \ No newline at end of file diff --git a/erpnext/patches/jan_mar_2012/website/cleanups.py b/erpnext/patches/jan_mar_2012/website/cleanups.py index 9a78a70dd5..b7b7736ad7 100644 --- a/erpnext/patches/jan_mar_2012/website/cleanups.py +++ b/erpnext/patches/jan_mar_2012/website/cleanups.py @@ -12,10 +12,6 @@ def execute(): # 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'""") diff --git a/erpnext/patches/jan_mar_2012/website/website.py b/erpnext/patches/jan_mar_2012/website/website.py index 4ffb441738..3494b709d2 100644 --- a/erpnext/patches/jan_mar_2012/website/website.py +++ b/erpnext/patches/jan_mar_2012/website/website.py @@ -8,6 +8,10 @@ def execute(): from webnotes.modules import reload_doc from webnotes.model import delete_doc + # cleanup page + delete_doc("DocType", "Page") + reload_doc("core", "doctype", "page") + reload_doc('setup', 'doctype', 'item_group') delete_doc('Website', 'Module Def', 'Website') reload_doc('website', 'Module Def', 'Website') @@ -23,7 +27,6 @@ def execute(): reload_doc('website', 'doctype', 'about_us_settings') reload_doc('website', 'doctype', 'about_us_team') reload_doc('website', 'doctype', 'blog') - reload_doc('website', 'doctype', 'blog_subscriber') reload_doc('website', 'doctype', 'contact_us_settings') reload_doc('website', 'doctype', 'product') reload_doc('website', 'doctype', 'product_group') diff --git a/wnf.py b/wnf.py index 52308d0902..cc82eb56ed 100755 --- a/wnf.py +++ b/wnf.py @@ -54,6 +54,8 @@ def setup_options(): help="reload doc") parser.add_option('--export_doc', nargs=2, metavar = "doctype docname", help="export doc") + parser.add_option('--install', nargs=3, metavar = "rootpassword dbname source", + help="install fresh db") return parser.parse_args() @@ -132,6 +134,12 @@ def run(): webnotes.modules.patch_handler.run_all() print '\n'.join(webnotes.modules.patch_handler.log_list) + elif options.install: + from webnotes.install_lib.install import Installer + inst = Installer('root', options.install[0]) + inst.import_from_db(options.install[1], source_path=options.install[2], \ + password='admin', verbose = 1) + # print messages if webnotes.message_log: print '\n'.join(webnotes.message_log)