fix: replace key with object when expand is given in query param
This commit is contained in:
parent
36012487f9
commit
f8c73cb254
2 changed files with 3 additions and 7 deletions
|
|
@ -4,10 +4,6 @@ from werkzeug.routing import Rule
|
|||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.desk.form.load import (
|
||||
get_title_values_for_link_and_dynamic_link_fields,
|
||||
get_title_values_for_table_and_multiselect_fields,
|
||||
)
|
||||
from frappe.utils.data import sbool
|
||||
|
||||
|
||||
|
|
@ -82,7 +78,7 @@ def read_doc(doctype: str, name: str):
|
|||
doc.check_permission("read")
|
||||
doc.apply_fieldlevel_read_permissions()
|
||||
doc_dict = doc.as_dict()
|
||||
if frappe.form_dict.get("expand_links") and json.loads(frappe.form_dict["expand_links"]):
|
||||
if frappe.form_dict.get("expand_links") and frappe.form_dict["expand_links"]:
|
||||
get_values_for_link_and_dynamic_link_fields(doc_dict)
|
||||
get_values_for_table_and_multiselect_fields(doc_dict)
|
||||
|
||||
|
|
@ -100,7 +96,7 @@ def get_values_for_link_and_dynamic_link_fields(doc_dict):
|
|||
doctype = field.options if field.fieldtype == "Link" else doc_dict.get(field.options)
|
||||
|
||||
link_doc = frappe.get_doc(doctype, doc_fieldvalue)
|
||||
doc_dict.update({"_expanded_" + field.fieldname: link_doc})
|
||||
doc_dict.update({field.fieldname: link_doc})
|
||||
|
||||
|
||||
def get_values_for_table_and_multiselect_fields(doc_dict):
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ def get_list(
|
|||
val = li.get(fieldname)
|
||||
val_title = doctype_title_maps.get(link_doctype, {}).get(val)
|
||||
if val and val_title:
|
||||
li["_expanded_" + fieldname] = val_title
|
||||
li[fieldname] = val_title
|
||||
|
||||
return _list
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue