Hi all!
I’ve been working on a custom app, and I’ve encountered an issue that I would appreciate your insights on.
In my Javascript code, I am using frm.call()
to call an ERPNext server-side Python method. For example:
frm.call('establish_connection_to_marketplace_API');
This works perfectly. On the backend (I’m using ERPNext development container) I modified the frm.call()
function to log the actual path that it uses to resolve the Python method, and it revealed that the path is “marketplace_integration.marketplace_integration.doctype.marketplace_settings.marketplace_settings.establish_connection_to_marketplace_API”. It makes sense, as the local path for the file is /workspace/development/frappe-bench/apps/marketplace_integration/marketplace_integration/marketplace_integration/doctype/marketplace_settings/marketplace_settings.py
However, when I try to accomplish the same using frappe.call()
, like below, it fails:
frappe.call({
method: 'marketplace_integration.marketplace_integration.doctype.marketplace_settings.marketplace_settings.establish_connection_to_marketplace_API',
});
The frappe.call()
results in an error message:
“Failed to get method for command marketplace_integration.marketplace_integration.doctype.marketplace_settings.marketplace_settings.establish_connection_to_marketplace_API’ with module ‘marketplace_integration.marketplace_integration.doctype.marketplace_settings.marketplace_settings’ has no attribute ‘establish_connection_to_marketplace_API’”
I’m sooooooo confused In other JS files I need to use frappe.call (e.g. listview) and I don’t know what is wrong. Of course python function is whitelisted:
class MarketplaceSettings(Document):
@frappe.whitelist()
def establish_connection_to_marketplace_API(self):
Any smart people who know what is wrong? :< Thank you in advance for your assistance.