mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-29 09:54:47 +00:00
Create restrict-user-based-on-child-record.md
This commit is contained in:
committed by
Anand Doshi
parent
9b639b82cf
commit
c8fc5a2048
@@ -0,0 +1,20 @@
|
|||||||
|
## 15.3.1.7 Benutzer auf Grundlage eines Unterdatensatzes einschränken
|
||||||
|
|
||||||
|
// restrict certain warehouse to Material Manager
|
||||||
|
cur_frm.cscript.custom_validate = function(doc) {
|
||||||
|
if(user_roles.indexOf("Material Manager")==-1) {
|
||||||
|
|
||||||
|
var restricted_in_source = wn.model.get("Stock Entry Detail",
|
||||||
|
{parent:cur_frm.doc.name, s_warehouse:"Restricted"});
|
||||||
|
|
||||||
|
var restricted_in_target = wn.model.get("Stock Entry Detail",
|
||||||
|
{parent:cur_frm.doc.name, t_warehouse:"Restricted"})
|
||||||
|
|
||||||
|
if(restricted_in_source.length || restricted_in_target.length) {
|
||||||
|
msgprint("Only Material Manager can make entry in Restricted Warehouse");
|
||||||
|
validated = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{next}
|
||||||
Reference in New Issue
Block a user