import xhiveframework


def execute():
	if xhiveframework.db.table_exists("Offer Letter") and not xhiveframework.db.table_exists("Job Offer"):
		xhiveframework.rename_doc("DocType", "Offer Letter", "Job Offer", force=True)
		xhiveframework.rename_doc("DocType", "Offer Letter Term", "Job Offer Term", force=True)
		xhiveframework.reload_doc("hr", "doctype", "job_offer")
		xhiveframework.reload_doc("hr", "doctype", "job_offer_term")

		xhiveframework.delete_doc_if_exists("Print Format", {"name": "Offer Letter", "standard": "Yes"})
