[Fix] Not able to delete row in modal table (#13377)

diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js
index 0940288..27d7a2b 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.js
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.js
@@ -217,7 +217,7 @@
 			me.frm.doc['supplied_items'].forEach((item, index) => {
 			if (item.rm_item_code && item.main_item_code) {
 					me.raw_material_data.push ({
-						'name':index,
+						'name':item.name,
 						'item_code': item.main_item_code,
 						'rm_item_code': item.rm_item_code,
 						'item_name': item.rm_item_code,
diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js
index 0657f9f..52fcb38 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.js
+++ b/erpnext/selling/doctype/sales_order/sales_order.js
@@ -229,6 +229,7 @@
 								{fieldtype:'Data', fieldname:'sales_order_item', reqd: 1,
 									label: __('Sales Order Item'), hidden:1}
 							],
+							data: r.message,
 							get_data: function() {
 								return r.message
 							}
diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py
index 9e30939..8b0ecbf 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.py
+++ b/erpnext/selling/doctype/sales_order/sales_order.py
@@ -360,6 +360,7 @@
 							where production_item=%s and sales_order=%s and sales_order_item = %s and docstatus<2''', (i.item_code, self.name, i.name))[0][0])
 					if pending_qty:
 						items.append(dict(
+							name= i.name,
 							item_code= i.item_code,
 							bom = bom,
 							warehouse = i.warehouse,