[docs] removed the globals from documentation
diff --git a/erpnext/docs/user/manual/de/customize-erpnext/custom-scripts/custom-script-examples/date-validation.md b/erpnext/docs/user/manual/de/customize-erpnext/custom-scripts/custom-script-examples/date-validation.md
index 5bd2901..540d5cb 100644
--- a/erpnext/docs/user/manual/de/customize-erpnext/custom-scripts/custom-script-examples/date-validation.md
+++ b/erpnext/docs/user/manual/de/customize-erpnext/custom-scripts/custom-script-examples/date-validation.md
@@ -3,8 +3,8 @@
frappe.ui.form.on("Event", "validate", function(frm) {
if (frm.doc.from_date < get_today()) {
- msgprint(__("You can not select past date in From Date"));
- throw "past date selected"
+ frappe.msgprint(__("You can not select past date in From Date"));
+ frappe.throw(__("past date selected"))
}
});
diff --git a/erpnext/docs/user/manual/de/customize-erpnext/custom-scripts/custom-script-examples/restrict-cancel-rights.md b/erpnext/docs/user/manual/de/customize-erpnext/custom-scripts/custom-script-examples/restrict-cancel-rights.md
index d445a65..9e5ab13 100644
--- a/erpnext/docs/user/manual/de/customize-erpnext/custom-scripts/custom-script-examples/restrict-cancel-rights.md
+++ b/erpnext/docs/user/manual/de/customize-erpnext/custom-scripts/custom-script-examples/restrict-cancel-rights.md
@@ -4,12 +4,12 @@
Fügen Sie dem Ereignis custom_before_cancel eine Steuerungsfunktion hinzu:
cur_frm.cscript.custom_before_cancel = function(doc) {
- if (user_roles.indexOf("Accounts User")!=-1 && user_roles.indexOf("Accounts Manager")==-1
+ if (frappe.user_roles.indexOf("Accounts User")!=-1 && frappe.user_roles.indexOf("Accounts Manager")==-1
&& user_roles.indexOf("System Manager")==-1) {
if (flt(doc.grand_total) > 10000) {
- msgprint("You can not cancel this transaction, because grand total \
+ frappe.msgprint("You can not cancel this transaction, because grand total \
is greater than 10000");
- validated = false;
+ frappe.validated = false;
}
}
}
diff --git a/erpnext/docs/user/manual/de/customize-erpnext/custom-scripts/custom-script-examples/restrict-purpose-of-stock-entry.md b/erpnext/docs/user/manual/de/customize-erpnext/custom-scripts/custom-script-examples/restrict-purpose-of-stock-entry.md
index bb925e1..a1cb769 100644
--- a/erpnext/docs/user/manual/de/customize-erpnext/custom-scripts/custom-script-examples/restrict-purpose-of-stock-entry.md
+++ b/erpnext/docs/user/manual/de/customize-erpnext/custom-scripts/custom-script-examples/restrict-purpose-of-stock-entry.md
@@ -3,8 +3,8 @@
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";
+ frappe.msgprint("You are only allowed Material Receipt");
+ frappe.throw(__("Not allowed"));
}
}
diff --git a/erpnext/docs/user/manual/de/customize-erpnext/custom-scripts/custom-script-examples/restrict-user-based-on-child-record.md b/erpnext/docs/user/manual/de/customize-erpnext/custom-scripts/custom-script-examples/restrict-user-based-on-child-record.md
index db725f2..652409f 100644
--- a/erpnext/docs/user/manual/de/customize-erpnext/custom-scripts/custom-script-examples/restrict-user-based-on-child-record.md
+++ b/erpnext/docs/user/manual/de/customize-erpnext/custom-scripts/custom-script-examples/restrict-user-based-on-child-record.md
@@ -3,17 +3,16 @@
// 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",
+ if(frappe.user_roles.indexOf("Material Manager")==-1) {
+ var restricted_in_source = frappe.model.get_list("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"})
+ var restricted_in_target = frappe.model.get_list("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;
+ frappe.msgprint(__("Only Material Manager can make entry in Restricted Warehouse"));
+ frappe.validated = false;
}
}
}
diff --git a/erpnext/docs/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/date-validation.md b/erpnext/docs/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/date-validation.md
index d68ab56..6e560cb 100644
--- a/erpnext/docs/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/date-validation.md
+++ b/erpnext/docs/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/date-validation.md
@@ -3,8 +3,8 @@
frappe.ui.form.on("Task", "validate", function(frm) {
if (frm.doc.from_date < get_today()) {
- msgprint(__("You can not select past date in From Date"));
- validated = false;
+ frappe.msgprint(__("You can not select past date in From Date"));
+ frappe.validated = false;
}
});
diff --git a/erpnext/docs/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/restrict-cancel-rights.md b/erpnext/docs/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/restrict-cancel-rights.md
index e5037fe..79fe9a5 100644
--- a/erpnext/docs/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/restrict-cancel-rights.md
+++ b/erpnext/docs/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/restrict-cancel-rights.md
@@ -3,12 +3,12 @@
cur_frm.cscript.custom_before_cancel = function(doc) {
- if (user_roles.indexOf("Accounts User")!=-1 && user_roles.indexOf("Accounts Manager")==-1
+ if (frappe.user_roles.indexOf("Accounts User")!=-1 && frappe.user_roles.indexOf("Accounts Manager")==-1
&& user_roles.indexOf("System Manager")==-1) {
if (flt(doc.grand_total) > 10000) {
- msgprint("You can not cancel this transaction, because grand total \
+ frappe.msgprint("You can not cancel this transaction, because grand total \
is greater than 10000");
- validated = false;
+ frappe.validated = false;
}
}
}
diff --git a/erpnext/docs/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/restrict-purpose-of-stock-entry.md b/erpnext/docs/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/restrict-purpose-of-stock-entry.md
index 9b37eb5..f3efd98 100644
--- a/erpnext/docs/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/restrict-purpose-of-stock-entry.md
+++ b/erpnext/docs/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/restrict-purpose-of-stock-entry.md
@@ -1,8 +1,8 @@
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";
+ if(frappe.user=="user1@example.com" && frm.doc.purpose!="Material Receipt") {
+ frappe.msgprint("You are only allowed Material Receipt");
+ frappe.throw(__("Not allowed"));
}
}
diff --git a/erpnext/docs/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/restrict-user-based-on-child-record.md b/erpnext/docs/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/restrict-user-based-on-child-record.md
index 6c36a14..849e686 100644
--- a/erpnext/docs/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/restrict-user-based-on-child-record.md
+++ b/erpnext/docs/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/restrict-user-based-on-child-record.md
@@ -1,16 +1,16 @@
// restrict certain warehouse to Material Manager
cur_frm.cscript.custom_validate = function(doc) {
- if(user_roles.indexOf("Material Manager")==-1) {
+ if(frappe.user_roles.indexOf("Material Manager")==-1) {
- var restricted_in_source = wn.model.get("Stock Entry Detail",
+ var restricted_in_source = frappe.model.get_list("Stock Entry Detail",
{parent:cur_frm.doc.name, s_warehouse:"Restricted"});
- var restricted_in_target = wn.model.get("Stock Entry Detail",
+ var restricted_in_target = frappe.model.get_list("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");
+ frappe.msgprint(__("Only Material Manager can make entry in Restricted Warehouse"));
validated = false;
}
}