From e56eaf6364ac592bb1e1393dbb21e88e4afbed04 Mon Sep 17 00:00:00 2001 From: Mangesh-Khairnar Date: Fri, 3 May 2019 21:19:59 +0530 Subject: [PATCH] perf: improve mapping function speed --- erpnext/accounts/doctype/payment_request/payment_request.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/payment_request/payment_request.py b/erpnext/accounts/doctype/payment_request/payment_request.py index 64c4124da6..9b0ef42b8e 100644 --- a/erpnext/accounts/doctype/payment_request/payment_request.py +++ b/erpnext/accounts/doctype/payment_request/payment_request.py @@ -14,7 +14,6 @@ from frappe.integrations.utils import get_payment_gateway_controller from frappe.utils.background_jobs import enqueue from erpnext.erpnext_integrations.stripe_integration import create_stripe_subscription from erpnext.accounts.doctype.subscription_plan.subscription_plan import get_plan_rate -from frappe.model.mapper import get_mapped_doc class PaymentRequest(Document): def validate(self): @@ -426,6 +425,7 @@ def get_subscription_details(reference_doctype, reference_name): @frappe.whitelist() def make_payment_order(source_name, target_doc=None): + from frappe.model.mapper import get_mapped_doc def set_missing_values(source, target): target.append('references', { 'reference_doctype': source.reference_doctype, @@ -444,4 +444,4 @@ def make_payment_order(source_name, target_doc=None): } }, target_doc, set_missing_values) - return doclist + return doclist \ No newline at end of file