brotherton-erpnext/erpnext/docs/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/restrict-purpose-of-stock-entry.md

11 lines
271 B
Markdown
Raw Normal View History

2015-11-05 11:25:10 +00:00
frappe.ui.form.on("Material Request", "validate", function(frm) {
if(user=="user1@example.com" && frm.doc.purpose!="Material Receipt") {
msgprint("You are only allowed Material Receipt");
throw "Not allowed";
}
}
{next}