Please paste the code instead of taking a screenshot. It will be more readable and easier to check.
Please state the file names and path, maybe there is something wrong.
Please paste the code instead of taking a screenshot. It will be more readable and easier to check.
Please state the file names and path, maybe there is something wrong.
Aggreed. May sure that on the PY you dont have a Func with no action like
def func():
# testing …Like this will return that error.
hi @ci2016
py file :
import frappe
@frappe_whitelist()
def updateworkflowstate():
frappe.db.get_value("Gaz Production", {well : filters.well, workflow_state : 'Approved by Supervisor', "name", function(r){
for i in xrange(1, r.length):
frappe.db.set_value("Gaz Production", r[i], 'workflow_state', 'test')
})
js file :
onload: function(report) {
report.page.add_inner_button(__('Approve'), function() {
var filters = filters.get_values();
frappe.call({
method : "sdxenergy_management.sdxenergy_management.report.wells_report.wells_report.updateworkflowstate",
args : { "filters" : filters },
callback : function(r){
frappe.msgprint("Approved sucessfully");
}
});
});
}
Please let me know the file pathes.
Do you have an empty __init__.py
in all those folders/directories? For example, in the wells_report folder?
The filter variable should be present as an argument.
def updateworkflowstate(filters)
Hope it helps
Can you confirm if you can access the method by doing this ?
bench execute sdxenergy_management.sdxenergy_management.report.wells_report.wells_report.updateworkflowstate
Remove the filters argument, and simply add a print('test')
statement and check if the method is accessible.
If this doesnt work, you havent set up _init_.py files.
So is it fixed now ?
Or it print output comes and bench execute is fine, but still the same exception ?
Check for any logs in browser console ?
Bench execute is fine bur still same error and the behavor of the function not executed i dont know why
Browser logs ?
its F12 in chrome
The first time when i click gives me not found in browser log but the second click the callback get executed and show me the message but the update workflow not executed
Its a weared problem
make a gif if you can ?
Its really hard to find the issue if we do not know whats happening
There was an error in your python syntax, which meant the method couldn’t be found.