Hello there,
I want the button shows only if the doc.docstatus==1 ( submitted ) only
and not shown before that !
Is there any idea how to do it in js?
this is the custom button :
frappe.ui.form.on("Sales Invoice", {
refresh: function(frm) {
frm.add_custom_button(__('Ready to send'), function () {
frappe.call({
method:"test_app.tasks.test.pub",
arg:{
'doctype':frm.doc.doctype,
'docname': frm.doc.name
},
callback: function(r){
frm.refresh()
}
})
});
}});