Adding a Link Filter on the leave_type field in Leave Application (via Customize Form) causes a Permission Error: You do not have permission to access field: Leave Type.0 when opening the dropdown, instead of applying the filter correctly.
The Leave Application doctype already has a built-in set_query on leave_type (from HRMS core JS) that returns leave types based on the employee’s allocation. When a custom Link Filter is added on top via Property Setter, the two queries seem to merge incorrectly into a malformed filter object — sending an invalid "0" key to the search_link API, which triggers the permission check failure.
Confirmed via backend that the Property Setter’s link_filters JSON is syntactically valid:
json
[
["Leave Type","name","in",["Leave Without Pay","Anniversary Leave","Compensatory Off"]]
]
[["Leave Type","name","in",["Leave Without Pay","Anniversary Leave","Compensatory Off"]]]
So the issue is not in the filter syntax itself, but in how it interacts with HRMS’s existing hardcoded query for this field.
Workaround: Using a Client Script with frm.set_query() instead of a Customize Form Link Filter avoids the conflict, since it fully overrides rather than merges with the core query.
Asking: Is this expected behavior when combining Link Filters with fields that already have app-level set_query logic, or is this a bug in leave_application.js?