How to customise autocomplete suggestion


I have one question that how i customise autocomplete suggestion list.

Currently suppose i linked with item doctype that in autocomplete list i got item name and item group but i also want item unit to combine with item group in autocomplete list.

So anyone can assist me how it would be possible.

Harsh Mehta

Add Item Unit in Search Fields from customize form.

Hi saurabh,

Thanks for quick reply. It works in item doctype but it didn’t work for supplier doctype.

I want credit days in supplier autocomplete list but i can’t fetch credit days in supplier autocomplete list.

SO please assist me how would i get credit days in autocomplete list.

Please find attached screenshots.

Harsh Mehta

1 Like

Thanks for the detailed explanation.

Sometimes there are custom queries in ( that do not honour search_fields. This needs to be fixed in the product.

Edit: added link


@rmehta Thanks for quick reply. :slight_smile:

I got credit days in autocomplete box by way you suggested. But i want to know which way supplier_query function of file would be called from purchase order doctype .

Also i didn’t understand first line of supplier_query function. from where supp_master_name is set

eg : frappe.defaults.get_user_default(“supp_master_name”)

Also i have attached screenshot of supplier_query function.

So please assist me as i have to clear my doubts regarding autocomplete box

Harsh Mehta

If you have doubt you can also login to bench via your console and execute the line

bench --site [yoursite]
>>> import frappe.defaults
>>> frappe.defaults.get_user_default("supp_master_name")

Hi having the same issue but not finding the path