fix: dont show View button on cancelled SCR

This commit is contained in:
s-aga-r 2023-11-24 12:17:05 +05:30
parent 98cba5ed30
commit dd80d3b9b9

View File

@ -24,7 +24,7 @@ frappe.ui.form.on('Subcontracting Receipt', {
}, },
refresh: (frm) => { refresh: (frm) => {
if (frm.doc.docstatus > 0) { if (frm.doc.docstatus === 1) {
frm.add_custom_button(__('Stock Ledger'), () => { frm.add_custom_button(__('Stock Ledger'), () => {
frappe.route_options = { frappe.route_options = {
voucher_no: frm.doc.name, voucher_no: frm.doc.name,