import frappe


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

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