Permission to run Method

I have created a Custom Script and added a button … when I click on the Button with the method it says I have no permission to run … How to allow ?
As you can see the method is called from another path (current custom app)

frappe.ui.form.on(“Sales Order”,“cambio_bna”, function(frm,cdt,cdn) {
method: “gestoficinas.gestoficinas.doctype.cambios.cambios”,
args: {
callback: function(r) {
taxavenda = r.message


Add frappe.whitelist() in your python before definition of this method

def cambios():
    \\Your Logic

Hope this helps to solve your issue.

@shreyasp thanks it worked :slight_smile: