Method @frappe.whiltelist()

Im trying pass in javascript the method of my custom app, but im not having success in that.
My python code are in: frappe-bench/apps/financeiro/financeiro/financeiro/doctype/titulos/titulos.py

How can i call that?

Plese see my example :

// msg: button name
frappe.ui.form.on("yourdoctype", "msg",
    function(frm) {

        frappe.call({
            "method": "financeiro.financeiro.doctype.titulos.titulos.call_me"
        ,
            callback: function (data) {
              console.log(data);
            }
        })
    });

You have to declare a whitelisted method in your py module

@frappe.whitelist()
def call_me():
  msgprint("call me")
  return "call_me data"
2 Likes

py module or py doctype?

@Leonardo_Augusto sorry, add it in titulos.py

Let me try, thank you for now

That works!
Thanks for help @Mohammed_Redha