IntegrityError: (1062, "Duplicate entry 'Sales Taxes and Charges Template' for key 'PRIMARY'")

@vishdha I think I found the problem. On code erpnext.patches.v5_0.rename_taxes_and_charges_master
This is the code:
import frappe

def execute():
	if frappe.db.table_exists("Sales Taxes and Charges Master"):
		frappe.rename_doc("DocType", "Sales Taxes and Charges Master",
			"Sales Taxes and Charges Template")
		frappe.delete_doc("DocType", "Sales Taxes and Charges Master")

	if frappe.db.table_exists("Purchase Taxes and Charges Master"):
		frappe.rename_doc("DocType", "Purchase Taxes and Charges Master",
			"Purchase Taxes and Charges Template")
		frappe.delete_doc("DocType", "Purchase Taxes and Charges Master")

The thing is that table Sales Taxes and Charges Master exists, also table Sales Taxes and Charges Template also exists, so you can not rename to an database that already exists. But even when I try to delete Sales Taxes and Charges Template so it can be renamed still gives me this error.