Error : The resource you are looking for is not available

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.

1 Like

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?

yes i have the init file @ci2016

The filter variable should be present as an argument.

def updateworkflowstate(filters)

Hope it helps

1 Like

Hi @fahimalizain
Thank you its already there just i forget to type it.

Still the problem

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.

hi @fahimalizain sorry for delay
after execeute command print test in the console.

thank you

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 :slight_smile:

1 Like

Sorry i am out now my head is blocked i will back home and send a img

Thank you @fahimalizain

sorry @fahimalizain for the delay this is the screen shot

Thank you @fahimalizain for your great help issue resolved.

There was an error in your python syntax, which meant the method couldn’t be found.

1 Like