brotherton-erpnext/erpnext/docs/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/restrict-purpose-of-stock-entry.md
2017-07-31 16:21:12 +05:30

332 B

Restrict Purpose Of Stock Entry

frappe.ui.form.on("Material Request", "validate", function(frm) {
    if(frappe.user=="user1@example.com" && frm.doc.purpose!="Material Receipt") {
        frappe.msgprint("You are only allowed Material Receipt");
        frappe.throw(__("Not allowed"));
    }
}

{next}