brotherton-erpnext/patches/january_2013/change_patch_structure.py
2013-11-20 13:00:28 +05:30

16 lines
478 B
Python

# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import webnotes
def execute():
webnotes.reload_doc("core", "doctype", "patch_log")
if webnotes.conn.table_exists("__PatchLog"):
for d in webnotes.conn.sql("""select patch from __PatchLog"""):
webnotes.doc({
"doctype": "Patch Log",
"patch": d[0]
}).insert()
webnotes.conn.commit()
webnotes.conn.sql("drop table __PatchLog")