Can you provide the screenshot of your code in work_order.py and file structure in directory work_order?
I believe that run_method
is used for running Docâs methods. I can see that your method is written outside the DocTypeâs Class Declaration even though its present in side the Classâs Py file.
So instead of using âurlâ attribute, try specifying âmethodâ as below:
"method": "custom_app.custom_app.doctype.work_order.work_order.stop_unstop"
Assuming that the dotted path is the one you could import from bench console.
I receive the same error: Not found. The resource you are looking for is not available
error in your python logic you check that first by postmanâŚ
I have used both attributes and it is still returning the same error. Still, I can import the function with the bench console command.
after you modified the code, have you restarted bench?
Yes, I restarted it using bench restart command
There it is⌠your path should be custom_app.work_order.doctype.work_order.work_order.stop_unstop
Note the change in path from custom_app
to work_order
. This part of path generally indicates module name.
The anatomy of path is generally
<app name>.<module_name>.doctype.<doctype folder name>.<doctype file name>.<method name>
Worked for me thankyou