diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 480facb3ce..d711e1f17b 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -604,3 +604,4 @@ execute:frappe.delete_doc("Report", "Inactive Items") erpnext.patches.v11_1.delete_scheduling_tool erpnext.patches.v12_0.make_custom_fields_for_bank_remittance execute:frappe.delete_doc_if_exists("Page", "support-analytics") +erpnext.patches.v12_0.set_priority_for_issue diff --git a/erpnext/patches/v12_0/set_priority_for_issue.py b/erpnext/patches/v12_0/set_priority_for_issue.py new file mode 100644 index 0000000000..13d0de1311 --- /dev/null +++ b/erpnext/patches/v12_0/set_priority_for_issue.py @@ -0,0 +1,15 @@ +import frappe + +def execute(): + priorities = frappe.get_meta("Issue").get_field("priority").options.split("\n") + + for priority in priorities: + frappe.get_doc({ + "doctype": "Issue Priority", + "name":priority + }).insert(ignore_permissions=True) + + frappe.reload_doc("support", "doctype", "issue") + + for issue in frappe.get_list("Issue", fields=["name", "priority"]): + frappe.db.set_value("Issue", issue.name, "priority", issue.priority) \ No newline at end of file