diff --git a/erpnext/templates/form_grid/includes/visible_cols.html b/erpnext/templates/form_grid/includes/visible_cols.html
index 8d79bcdf879..578335ddcd4 100644
--- a/erpnext/templates/form_grid/includes/visible_cols.html
+++ b/erpnext/templates/form_grid/includes/visible_cols.html
@@ -3,7 +3,7 @@
if((df.fieldname !== "description" && df.fieldname !== "item_name") && val) { %}
- {%= __(df.label, null, df.parent) %}:
+ {%= frappe.utils.escape_html(__(df.label, null, df.parent)) %}:
{%= doc.get_formatted(df.fieldname) %}
diff --git a/erpnext/templates/form_grid/item_grid.html b/erpnext/templates/form_grid/item_grid.html
index 72db6c8e653..fac31c7c1a1 100644
--- a/erpnext/templates/form_grid/item_grid.html
+++ b/erpnext/templates/form_grid/item_grid.html
@@ -31,7 +31,7 @@
} %}
- {%= doc.warehouse %}
+ {%= frappe.utils.escape_html(doc.warehouse) %}
{% } %}
@@ -42,14 +42,14 @@
doc.delivered_qty : doc.received_qty;
var pending = flt(doc.qty) - flt(delivered);
%}
- {%= doc.item_code %}
+ {%= frappe.utils.escape_html(doc.item_code) %}
{% } else { %}
- {%= doc.item_code %}
+ {%= frappe.utils.escape_html(doc.item_code) %}
{% } %}
{% if(doc.item_name != doc.item_code && in_list(visible_column_fieldnames, "item_name")) { %}
{% if (doc.item_code) { %}
{% } %}
- {%= doc.item_name %}{% } %}
+ {%= frappe.utils.escape_html(doc.item_name) %}{% } %}
{% include "templates/form_grid/includes/visible_cols.html" %}
@@ -57,7 +57,7 @@
{%= doc.get_formatted("qty") %}
- {%= doc.uom || doc.stock_uom %}
+ {%= frappe.utils.escape_html(doc.uom || doc.stock_uom) %}
@@ -84,7 +84,7 @@
{% if (frappe.perm.is_visible("rate", doc, frm.perm)) { %}
- {%= doc.get_formatted("qty") %} {%= doc.uom || doc.stock_uom %}
+ {%= doc.get_formatted("qty") %} {%= frappe.utils.escape_html(doc.uom || doc.stock_uom) %}
x {%= doc.get_formatted("rate") %}
{% } %}
diff --git a/erpnext/templates/form_grid/material_request_grid.html b/erpnext/templates/form_grid/material_request_grid.html
index 866c06e5863..ff58da62ab5 100644
--- a/erpnext/templates/form_grid/material_request_grid.html
+++ b/erpnext/templates/form_grid/material_request_grid.html
@@ -11,9 +11,9 @@
{% } else { %}
- {%= doc.item_code %}
+ {%= frappe.utils.escape_html(doc.item_code) %}
{% if(doc.item_name != doc.item_code) { %}
-
{%= doc.item_name %}{% } %}
+
{%= frappe.utils.escape_html(doc.item_name) %}{% } %}
{% include "templates/form_grid/includes/visible_cols.html" %}
@@ -35,7 +35,7 @@
{% if(doc.warehouse) { %}
- {%= doc.warehouse %}
+ {%= frappe.utils.escape_html(doc.warehouse) %}
{% } %}
@@ -43,7 +43,7 @@
{%= doc.get_formatted("qty") %}
- {%= doc.uom || doc.stock_uom %}
+ {%= frappe.utils.escape_html(doc.uom || doc.stock_uom) %}
{% } %}
diff --git a/erpnext/templates/form_grid/stock_entry_grid.html b/erpnext/templates/form_grid/stock_entry_grid.html
index 8604881812d..d0afa926c50 100644
--- a/erpnext/templates/form_grid/stock_entry_grid.html
+++ b/erpnext/templates/form_grid/stock_entry_grid.html
@@ -12,9 +12,9 @@
{% } else { %}
-
{%= doc.item_code %}
+
{%= frappe.utils.escape_html(doc.item_code) %}
{% if(doc.item_name != doc.item_code) { %}
-
{%= doc.item_name %}{% } %}
+
{%= frappe.utils.escape_html(doc.item_name) %}{% } %}
{% include "templates/form_grid/includes/visible_cols.html" %}
@@ -30,11 +30,11 @@
}
%}
- {%= doc.s_warehouse %}
+ {%= frappe.utils.escape_html(doc.s_warehouse) %}
{% }; %}
{% if(doc.t_warehouse) { %}
- {%= doc.t_warehouse %}
+ {%= frappe.utils.escape_html(doc.t_warehouse) %}
{% }; %}
@@ -42,7 +42,7 @@
{%= doc.get_formatted("qty") %}
-
{%= doc.uom || doc.stock_uom %}
+
{%= frappe.utils.escape_html(doc.uom || doc.stock_uom) %}