Errorin search link API Due to Virtual Docs

Hi,

I have a couple of Virtual Documents in the tenant, which are given by an ERP Next patch.

After this patch, there is an error while trying to add a User Permission for a given document i.e. if I try to add a User Permission, such that I can see only my Projects, then when I try to add the applicable for doctype in the screen “Frappe Cloud

The moment I start typing in this text box, an api is called

curl 'https://idml.ptstdm.in/api/method/frappe.desk.search.search_link' \
  -H 'authority: idml.ptstdm.in' \
  -H 'accept: application/json' \
  -H 'accept-language: en-IN,en-GB;q=0.9,en-US;q=0.8,en;q=0.7,hi;q=0.6' \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/x-www-form-urlencoded; charset=UTF-8' \
  -H 'cookie: sid=eb51738e95ccbc303ae2149d1b401e223abd9ad79816a72ef50cf551; system_user=yes; full_name=Abhishek%20Kumar; user_id=abhishek%40idesignmylife.net; user_image=' \
  -H 'origin: https://idml.ptstdm.in' \
  -H 'pragma: no-cache' \
  -H 'referer: https://idml.ptstdm.in/app/user-permission/new-user-permission-bszuqwyvwu' \
  -H 'sec-ch-ua: "Google Chrome";v="119", "Chromium";v="119", "Not?A_Brand";v="24"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: same-origin' \
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36' \
  -H 'x-frappe-cmd;' \
  -H 'x-frappe-csrf-token: 79edbdd0fcc60555655cab3fb99fe01513ade374e3f4564f5b5e36e1' \
  -H 'x-frappe-doctype: User' \
  -H 'x-requested-with: XMLHttpRequest' \
  --data-raw 'txt=&doctype=User&ignore_user_permissions=0&reference_doctype=User+Permission&query=frappe.core.doctype.user_permission.user_permission.get_applicable_for_doctype_list' \
  --compressed

This results in an error which looks like…

### App Versions

{
“erpnext”: “14.39.0”,
“frappe”: “14.49.0”,
“hrms”: “14.10.6”,
“india_compliance”: “14.16.2”,
“ptstdm”: “0.0.1”
}

### Route

Form/User Permission/new-user-permission-1

### Traceback

Traceback (most recent call last):
File “apps/frappe/frappe/app.py”, line 95, in application
response = frappe.api.handle()
^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/api.py”, line 54, in handle
return frappe.handler.handle()
^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/handler.py”, line 47, in handle
data = execute_cmd(cmd)
^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/handler.py”, line 85, in execute_cmd
return frappe.call(method, **frappe.form_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/init.py”, line 1622, in call
return fn(*args, **newargs)
^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/desk/search.py”, line 37, in search_link
search_widget(
File “apps/frappe/frappe/desk/search.py”, line 108, in search_widget
raise e
File “apps/frappe/frappe/desk/search.py”, line 85, in search_widget
frappe.response[“values”] = frappe.call(
^^^^^^^^^^^^
File “apps/frappe/frappe/init.py”, line 1622, in call
return fn(*args, **newargs)
^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/init.py”, line 2417, in wrapper
return fn(**kwargs)
^^^^^^^^^^^^
File “apps/frappe/frappe/core/doctype/user_permission/user_permission.py”, line 142, in get_applicable_for_doctype_list
linked_doctypes_map = get_linked_doctypes(doctype, True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/desk/form/linked_with.py”, line 534, in get_linked_doctypes
return frappe.cache().hget(
^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/utils/redis_wrapper.py”, line 205, in hget
value = generator()
^^^^^^^^^^^
File “apps/frappe/frappe/desk/form/linked_with.py”, line 537, in
lambda: _get_linked_doctypes(doctype, without_ignore_user_permissions_enabled),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/desk/form/linked_with.py”, line 547, in _get_linked_doctypes
ret.update(get_dynamic_linked_fields(doctype, without_ignore_user_permissions_enabled))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/desk/form/linked_with.py”, line 643, in get_dynamic_linked_fields
possible_link = frappe.get_all(
^^^^^^^^^^^^^^^
File “apps/frappe/frappe/init.py”, line 1939, in get_all
return get_list(doctype, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/init.py”, line 1911, in get_list
return frappe.model.db_query.DatabaseQuery(doctype).execute(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/model/db_query.py”, line 188, in execute
return controller.get_list(kwargs)
^^^^^^^^^^^^^^^^^^^
AttributeError: type object ‘PaymentReconciliationAllocation’ has no attribute ‘get_list’
df.doctype==‘PaymentReconciliationAllocation’

### Request Data

{
“type”: “POST”,
“args”: {
“txt”: “”,
“doctype”: “User”,
“ignore_user_permissions”: 0,
“reference_doctype”: “User Permission”,
“query”: “frappe.core.doctype.user_permission.user_permission.get_applicable_for_doctype_list”
},
“headers”: {},
“error_handlers”: {},
“url”: “/api/method/frappe.desk.search.search_link”
}

### Response Data

{
“exception”: “AttributeError: type object ‘PaymentReconciliationAllocation’ has no attribute ‘get_list’”
}

The error is owing to PaymentReconciliationAllocation which is a virtual document introduced a couple of days back. Any idea on how to get this fixed ?
Thanks, Abhishek