From 90dd7294969c4ce8db16b52f3056e93911dc8e71 Mon Sep 17 00:00:00 2001 From: marination Date: Mon, 20 Apr 2020 20:31:27 +0530 Subject: [PATCH] fix: Migrate fails on `move_email_and_phone_to_child_table` patch --- .../patches/v12_0/move_email_and_phone_to_child_table.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frappe/patches/v12_0/move_email_and_phone_to_child_table.py b/frappe/patches/v12_0/move_email_and_phone_to_child_table.py index 4388d3c849..12680609d5 100644 --- a/frappe/patches/v12_0/move_email_and_phone_to_child_table.py +++ b/frappe/patches/v12_0/move_email_and_phone_to_child_table.py @@ -1,6 +1,10 @@ import frappe def execute(): + frappe.reload_doc("contacts", "doctype", "contact_email") + frappe.reload_doc("contacts", "doctype", "contact_phone") + frappe.reload_doc("contacts", "doctype", "contact") + contact_details = frappe.db.sql(""" SELECT `name`, `email_id`, `phone`, `mobile_no`, `modified_by`, `creation`, `modified` @@ -10,10 +14,6 @@ def execute(): and `tabContact Email`.email_id=`tabContact`.email_id) """, as_dict=True) - frappe.reload_doc("contacts", "doctype", "contact_email") - frappe.reload_doc("contacts", "doctype", "contact_phone") - frappe.reload_doc("contacts", "doctype", "contact") - email_values = [] phone_values = [] for count, contact_detail in enumerate(contact_details):