Merge pull request #26611 from akhilnarang/fix-address-search-fields-link
fix(address_query): show search fields in description if set
This commit is contained in:
commit
68c5307fd9
1 changed files with 8 additions and 1 deletions
|
|
@ -294,9 +294,15 @@ def address_query(doctype, txt, searchfield, start, page_len, filters):
|
|||
else:
|
||||
title = "`tabAddress`.city"
|
||||
|
||||
# Get additional search fields
|
||||
if searchfields:
|
||||
extra_query_fields = ",".join([f"`tabAddress`.{field}" for field in searchfields])
|
||||
else:
|
||||
extra_query_fields = "`tabAddress`.country"
|
||||
|
||||
return frappe.db.sql(
|
||||
"""select
|
||||
`tabAddress`.name, {title}, `tabAddress`.country
|
||||
`tabAddress`.name, {title}, {extra_query_fields}
|
||||
from
|
||||
`tabAddress`
|
||||
join `tabDynamic Link`
|
||||
|
|
@ -319,6 +325,7 @@ def address_query(doctype, txt, searchfield, start, page_len, filters):
|
|||
search_condition=search_condition,
|
||||
condition=condition or "",
|
||||
title=title,
|
||||
extra_query_fields=extra_query_fields,
|
||||
),
|
||||
{
|
||||
"txt": "%" + txt + "%",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue