Hello,
I created the following custom script:
in the server side I have a application with the name ‘customapp’
this is the file sitting in /home/myerpuser/mybench/apps/customapp/customapp/events.py
and this is the error I get “Not found” and in the console log I see the 404 not found error
does anybody know what I’m missing?
@rohit_w do you see something missing?
vijaywm
September 29, 2019, 4:22am
2
This error comes up often when there is an error in the py file… run getallme from bench console just to check if py is good.
root13F
September 29, 2019, 11:50am
3
Instead of customapp.events.getallme
in your custom script, use customapp.customapp.events.getallme
looks like the py is good I ran the function and it is returning the string without any error. I only found how to run it using bench execute, do you know how I can do it using the bench console?
I tried using “customapp.customapp.events.getallme”, but still getting the 404 not found error
vijaywm
September 30, 2019, 1:01am
6
Only other thing I can think of is are you running in Production mode or Development ( from bench start) ? If Production you have to sudo supervisorctl reload
for py changes to kick in.
hrwx
September 30, 2019, 1:14pm
7
Hey @alexsilva ,
Try this following, include your frappe.call in here
frappe.ui.form.on("Stock Entry", {
validate: function(frm) {
frappe.call({
method: "function path",
args: {
docname: frm.doc.name
},
callback: function(r) {}
})
},
});
Regards
@hrwx
1 Like
@root13F , @hrwx , @vijaywm thanks for your answers, I found my error, when I tried to install the ‘customapp’ I did:
bench new-app customapp
bench install-app customapp
the commands that fixed it were
bench --site mysite install-app customapp
bench --site mysite migrate