In my custom App, displaying Users in a link field.
but I want to show only some users, for that I have used set_query
below is my code,
++++
frm.set_query(“user”, function() {
return {
filters: [
[“User”,“email”, “in”, [“abc@gmail.com”, “xyz@gmail.com”]]
//[“User”,“first_name”, “in”, [“abc”, “xyz”]]
]
}
});
+++
getting below exception,
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 62, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 22, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 53, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 941, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/search.py”, line 14, in search_link
search_widget(doctype, txt, query, searchfield=searchfield, page_length=page_length, filters=filters)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/search.py”, line 39, in search_widget
searchfield, start, page_length, filters)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/search.py”, line 35, in search_widget
searchfield, start, page_length, filters, as_dict=as_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 941, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py”, line 819, in user_query
if filters and filters.get(‘ignore_user_type’):
AttributeError: ‘list’ object has no attribute ‘get’
what’s wrong here?
Any help?
Edit: This code has worked for other doctype then User in Link field.
Do I need to pass additional flag or something while filtering User Data??