brotherton-erpnext/patches/february_2013/p03_material_request.py

30 lines
1.2 KiB
Python
Raw Normal View History

2013-11-20 12:59:58 +05:30
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
2013-02-18 14:24:05 +05:30
import webnotes, os, sys
def execute():
webnotes.reload_doc("core", "doctype", "doctype")
2013-02-20 16:08:21 +05:30
2013-03-26 17:20:31 +01:00
tables = webnotes.conn.sql_list("show tables")
if not "tabMaterial Request Item" in tables:
2013-03-26 21:34:38 +05:30
webnotes.rename_doc("DocType", "Purchase Request Item", "Material Request Item", force=True)
2013-03-26 17:20:31 +01:00
if not "tabMaterial Request" in tables:
2013-03-26 21:34:38 +05:30
webnotes.rename_doc("DocType", "Purchase Request", "Material Request", force=True)
2013-02-20 16:08:21 +05:30
webnotes.reload_doc("stock", "doctype", "material_request")
webnotes.reload_doc("stock", "doctype", "material_request_item")
webnotes.conn.sql("""update `tabMaterial Request` set material_request_type='Purchase'""")
2013-02-18 14:24:05 +05:30
os.system("rm -rf app/buying/doctype/purchase_request")
os.system("rm -rf app/buying/doctype/purchase_request_item")
os.system("rm -rf app/hr/doctype/holiday_block_list")
os.system("rm -rf app/hr/doctype/holiday_block_list_allow")
os.system("rm -rf app/hr/doctype/holiday_block_list_date")
2013-03-26 17:20:31 +01:00
2013-05-16 15:57:45 +05:30
for dt in ("Purchase Request", "Purchase Request Item"):
if webnotes.conn.exists("DocType", dt):
webnotes.delete_doc("DocType", dt)