how to disable the action in sales invoice like the submit and rejected
the actions based in workflow
when some if condition
like the user is admin
frappe.ui.form.on('Sales Invoice', {
refresh(frm) {
if (frappe.session.user != "Administrator") {
// frm.enable_save();
} else {
// frm.disable_save();
setTimeout(() => {
frm.remove_custom_button('Actions', 'Help');
frm.remove_custom_button('Actions', 'Draft');
frm.remove_custom_button("Actions");
},700);
}
}
})