When a Link field has link_filters configured, the filters are correctly applied in the Form view, but they are ignored in the List View Add Filter dialog.
As a result, the Link autocomplete displays all records from the linked DocType instead of only those matching the configured link_filters.
This appears to be a general Frappe issue and is reproducible on standard DocTypes as well, not only on Virtual DocTypes.
Environment
Frappe Framework: v15.104.0 (HEAD)
Steps to Reproduce
-
Create a Link field:
Field Type: Link
Options: Location
Field Name: company
-
Configure the field with the following link_filters: [["Location", "custom_type", "=", "Company"]]
-
Open the DocType form.
-
Click the Company Link field.
-
Observe that the autocomplete correctly displays only Location records where custom_type = "Company".
-
Open the List View of the same DocType.
-
Click Add Filter.
-
Select the Company field.
-
Open the Link autocomplete.
Expected Behavior
The List View filter should honor the DocField's configured link_filters, just like the Form view.
The autocomplete should only display Location records matching:
custom_type = "Company"
Actual Behavior
The List View filter ignores the configured link_filters and displays all Location records (e.g. Company, Building, Region, etc.).
The selected value still filters the records correctly after selection, but the autocomplete itself is not restricted, making it difficult for users to find the correct values.
Investigation
The Link field metadata contains the configured link_filters:
"link_filters": "[["Location","custom_type","=","Company"]]"
However, the request sent from the List View autocomplete is:
POST /api/method/frappe.desk.search.search_link
txt=
doctype=Location
reference_doctype=Application User
page_length=10
The request does not include the field information (or the configured link_filters), so the autocomplete search cannot apply the field-specific restrictions.
Additional Notes
- The same Link field behaves correctly in the Form view.
- The issue is reproducible on standard DocTypes and is not limited to Virtual DocTypes.
- This appears to be a frontend issue in the List View filter's Link autocomplete, where the field's configured link_filters are not being propagated to the Link search.
When a Link field has link_filters configured, the filters are correctly applied in the Form view, but they are ignored in the List View Add Filter dialog.
As a result, the Link autocomplete displays all records from the linked DocType instead of only those matching the configured link_filters.
This appears to be a general Frappe issue and is reproducible on standard DocTypes as well, not only on Virtual DocTypes.
Environment
Frappe Framework: v15.104.0 (HEAD)
Steps to Reproduce
Create a Link field:
Field Type: Link
Options: Location
Field Name: company
Configure the field with the following link_filters: [["Location", "custom_type", "=", "Company"]]
Open the DocType form.
Click the Company Link field.
Observe that the autocomplete correctly displays only Location records where custom_type = "Company".
Open the List View of the same DocType.
Click Add Filter.
Select the Company field.
Open the Link autocomplete.
Expected Behavior
The List View filter should honor the DocField's configured link_filters, just like the Form view.
The autocomplete should only display Location records matching:
custom_type = "Company"
Actual Behavior
The List View filter ignores the configured link_filters and displays all Location records (e.g. Company, Building, Region, etc.).
The selected value still filters the records correctly after selection, but the autocomplete itself is not restricted, making it difficult for users to find the correct values.
Investigation
The Link field metadata contains the configured link_filters:
"link_filters": "[["Location","custom_type","=","Company"]]"
However, the request sent from the List View autocomplete is:
POST /api/method/frappe.desk.search.search_link
txt=
doctype=Location
reference_doctype=Application User
page_length=10
The request does not include the field information (or the configured link_filters), so the autocomplete search cannot apply the field-specific restrictions.
Additional Notes