Hello;
Can someone please explain for me what is the wn that is use in wn.model.get, wn.datetime.add_days?
Is it frappe class or what exactly?
Also I appreciate if someone can explain for me how it is work in the below example?
// 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;
}
}
}
Regards
Bilal