Hello All,
I have a scenario where I need to prevent the creation of multiple Purchase Orders from a Supplier Quotation. Currently, there is no built-in option to close a Supplier Quotation. Since I already have a workflow on the Supplier Quotation Doctype, I added a Closed status. The intention is that when the form reaches this status, the Create Purchase Order button should disappear. However, the client script does not work when I include this condition.
frappe.ui.form.on(‘Supplier Quotation’, {
refresh(frm) {
if (frm.doc.workflow_state === “Closed”) {
setTimeout(() => {
frm.remove_custom_button(‘Purchase Order’, ‘Create’);
}, 10);
}
}
});
Kindly advise on this issue.
Thanks