I defined a Server Script API Method using the Server Script doctype. I called the method “my_test_method”.
I wrote a Client Script that creates a MultiSelectDialog and uses the “query” attribute to invoke “my_test_method”. Unfortunately, when I try to use it, I get the error:
“App my_test_method is not installed”
Yeah that makes sense because the method is a Server Script method – its not really part of any module/app. Is there a default module to which all Server Script methods get assigned?
I tried “core” but that doesn’t work.
I tried “frappe” but that throws this error instead:
AttributeError: module ‘frappe’ has no attribute ‘get_expense_claims_having_non_invoiced_pass_through_expenses’
Indeed I had to delete my message because I realized it was very misleading.
The issue is that the MultiSelectDialog “query” parameter passes the query parameter to the server and then the server python code uses python frappe.call to invoke the method. This blows up because it expects a module!
This looks like it could be considered a design flaw or bug. Unless not allowing use of API Server Script from MultiSelectDialog is intentional?
I doubt it was intentional. Server Scripts are a relatively recent addition to Frappe, and they have a very different execution process than the one used by queries. I suspect it just has never been added as a possibility to MultiSelectDialogs. Link queries in general are probably due for a refactor at some point.