27 lines
883 B
Python
27 lines
883 B
Python
import webnotes
|
|
|
|
def execute():
|
|
delete_doctypes()
|
|
rename_module()
|
|
rebuilt_exploded_bom()
|
|
|
|
def delete_doctypes():
|
|
from webnotes.model import delete_doc
|
|
delete_doc("DocType", "Production Control")
|
|
delete_doc("DocType", "BOM Control")
|
|
|
|
def rename_module():
|
|
webnotes.rename_doc("Role", "Production User", "Manufacturing User")
|
|
webnotes.rename_doc("Role", "Production Manager", "Manufacturing Manager")
|
|
|
|
webnotes.rename_doc("Page", "production-home", "manufacturing-home")
|
|
|
|
webnotes.rename_doc("Module Def", "Production", "Manufacturing")
|
|
|
|
webnotes.conn.set_global("modules_list",
|
|
webnotes.conn.get_global('modules_list').replace("Production", "Manufacturing"))
|
|
|
|
def rebuilt_exploded_bom():
|
|
from webnotes.model.code import get_obj
|
|
for bom in webnotes.conn.sql("""select name from `tabBOM` where docstatus < 2"""):
|
|
get_obj("BOM", bom[0], with_children=1).on_update() |