Fetch Values of a one doctye to another doctype (auto populate fields on the basis of link field)

In this particular example we are fetching the bank details on the basis of IFSC code. There are two doctypes Bank Details IFSC and Av Production

frappe.ui.form.on('Av Production', {
    ifsc_code: function(frm) {
			method: "frappe.production_houses.doctype.av_production.api.get",
			args: {
				doctype:"Bank Details IFSC",
			callback: (r) => {
				if(r.message) {
					frm.set_value('bank_name', r.message.bank_name)

API.py file

import json
from os import name
import frappe
from frappe import _
from frappe.model.base_document import DOCTYPE_TABLE_FIELDS
from frappe.model.db_query import check_parent_permission
from frappe.query_builder.utils import DocType

def get(doctype, name=None ,filters=None, parent=None):
		if frappe.is_table(doctype):
			check_parent_permission(parent, doctype)
		if filters and not name:
			name = frappe.db.get_value(doctype, json.loads(filters))
			if not name:
				frappe.throw(_("No document found for given filters"))

		doc = frappe.get_doc(doctype, name)
		if not doc.has_permission("read"):
			raise frappe.PermissionError
		return frappe.get_doc(doctype, name).as_dict()