From 4b1345202210680e4bcb7bc4f299cc0db3829543 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 5 Sep 2022 18:27:03 +0530 Subject: [PATCH] fix: drop old notes column from lead and prospect --- .../migrate_existing_lead_notes_as_per_the_new_format.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/patches/v14_0/migrate_existing_lead_notes_as_per_the_new_format.py b/erpnext/patches/v14_0/migrate_existing_lead_notes_as_per_the_new_format.py index 6ba5a9ff21..032aeccc23 100644 --- a/erpnext/patches/v14_0/migrate_existing_lead_notes_as_per_the_new_format.py +++ b/erpnext/patches/v14_0/migrate_existing_lead_notes_as_per_the_new_format.py @@ -3,7 +3,7 @@ from frappe.utils import cstr, strip_html def execute(): - for doctype in ("Lead", "Prospect"): + for doctype in ("Lead", "Prospect", "Opportunity"): if not frappe.db.has_column(doctype, "notes"): continue @@ -19,3 +19,5 @@ def execute(): doc = frappe.get_doc(doctype, d.name) doc.append("notes", {"note": d.notes, "added_by": d.modified_by, "added_on": d.modified}) doc.update_child_table("notes") + + frappe.db.sql_ddl(f"alter table `tab{doctype}` drop column `notes`")